简单的shell操作老出错
发表于 : 2012-01-11 11:07
各位侠客,下面这段shell代码,老是出错,出错的地方见红色字体,不知道是什么原因呢.
#!/bin/csh
#TWO FILES NEEDED: INPUT FLOW ACCUMULATION AND OUTPUT FLOW DIRECTION
#30 arc-second flow accumulation grid
set ACC=lp_accum.asc
set OUT=lp_flow.asc
#output file is 1/8 degree -- change script for other resolutions
#END OF INPUT
#dump top six lines - get number of ROWS and COLS
head -6 $ACC >! temp_head.junk #无法打开 “temp_head.junk” 读取数据: 没有那个文件或目录
#>!这个符号表示什么意思呢???
set ROWS=`gawk '{if(NR==2) print $2}' temp_head.junk` gawk: 命令行:1: 致命错误: 无法以读模式打开文件“temp_head.junk”(没有那个文件或目录)
set COLS=`gawk '{if(NR==1) print $2}' temp_head.junk`
#!/bin/csh
#TWO FILES NEEDED: INPUT FLOW ACCUMULATION AND OUTPUT FLOW DIRECTION
#30 arc-second flow accumulation grid
set ACC=lp_accum.asc
set OUT=lp_flow.asc
#output file is 1/8 degree -- change script for other resolutions
#END OF INPUT
#dump top six lines - get number of ROWS and COLS
head -6 $ACC >! temp_head.junk #无法打开 “temp_head.junk” 读取数据: 没有那个文件或目录
#>!这个符号表示什么意思呢???
set ROWS=`gawk '{if(NR==2) print $2}' temp_head.junk` gawk: 命令行:1: 致命错误: 无法以读模式打开文件“temp_head.junk”(没有那个文件或目录)
set COLS=`gawk '{if(NR==1) print $2}' temp_head.junk`