科学网

 找回密码
  注册
C shell:求一组残差序列的均值和RMS
周锋 2016-4-4 23:47
set mean = `awk 'BEGIN {n = 0} {n = n+1; sum = sum+$1} END {if (n != 0) {printf(℅.2fn,sum/n)}}' tmp.enu` set rms = `awk 'BEGIN {n = 0} {n = n+1; t = $1; sum = sum+t*t} END {if (n != 0) {printf(℅.2fn,sqrt(sum/n))}}' tmp.enu`
个人分类: Shell|3232 次阅读|没有评论
一个有用的小脚本
周锋 2012-11-2 12:42
如何从“abcdefg”字符串中提子串“bc”并赋给另外一个字符串变量: str=`expr substr 'abcdefg' 2 2` 即可。
个人分类: Shell|3401 次阅读|没有评论
分别输出年月日的C shell脚本
周锋 2011-11-4 07:45
最近想写一个批量下载ftp数据的文件,但上面的文件是诸如2010-01-10.类似这样开头的文件,有点头疼,因此,首先要解决分别输出年月日的脚本,通过借鉴gamit的脚本,提出来三种解决方案,把此问题已经解决,但第三种的cut解决方案待解决,希望把cut方案解决的朋友发给我下,脚本如下: #!/bin/tcsh -f #取日期2010-01-10为 ...
个人分类: Shell|4054 次阅读|没有评论
ubuntu下tcsh配置文件.tcshrc(供参考)
周锋 2011-10-25 17:10
# set prompt set prompt = " % " set history = 50 #set system path set path = (. /bin /sbin /etc /usr/bin /usr/sbin /usr/bin/X11 /usr/X11R6/bin $path) set path = (. /usr/local/bin /usr/local/sbin /usr/local/lib /usr/lib $path) setenv PATH "/usr/sbin:/sbin:${PATH}" setenv MANPATH /usr/loc ...
个人分类: Shell|9878 次阅读|没有评论
ubuntu下bash配置文件.bashrc(供参考)
周锋 2011-10-25 17:08
# ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # If not running interactively, don't do anything return # don't put duplicate lines in the history. See bash(1) for more options # ... or force ...
个人分类: Shell|10360 次阅读|没有评论

本页有 2 篇博文因作者的隐私设置或未通过审核而隐藏

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-25 15:32

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部