shanbin的个人博客分享 http://blog.sciencenet.cn/u/shanbin

博文

Shell (csh)下的一些命令

已有 15022 次阅读 2013-10-4 14:24 |个人分类:Linux学习|系统分类:科研笔记

1. 多个文件的循环

   foreach event (20*)

   end

2. 判断存在与否

  if(-d $event) then   | -d 判断文件夹是否存在

  if(-e flag_SNR.dat)  | -e 判断文件是否存在

  ! -e 文件不存在为真

3. touch flag.dat       | 生成一个空文件

4. Command: csh ex01.csh 1.txt 2.txt

   in ex01.csh: set file1=$1; set file2=$2 即可把文件名赋值给字符变量$file1,$file2

   类似于fortran里面的getarg (call getarg(1,file1);call getarg(2,file2))

5. execute<inputfile |  单一输入文件的可执行文件

6. 运行符号``

   set para1 = `awk '{print $1}' 1.txt`



https://wap.sciencenet.cn/blog-1000382-729962.html

上一篇:Fortran 生成0-1之间的随机数
下一篇:Uncertainties of Elevation, SHF, Geoid @ LitMod
收藏 IP: 137.111.13.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

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

GMT+8, 2024-5-21 18:04

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部