由买买提看人间百态

topics

全部话题 - 话题: workdir
(共0页)
a*******e
发帖数: 3021
1
来自主题: Linux版 - 怎么使用awk?
一个文件如下内容 $WORKDIR/Ycolour
Thu Oct 22 18:35:34 EDT 2009
pnmpsnr: PSNR between /home/temp/abc/b1.ppm and /home/temp/abc/b2.ppm:
pnmpsnr: Y color component: 41.55 dB
pnmpsnr: Cb color component: 42.03 dB
pnmpsnr: Cr color component: 43.70 dB
怎么抓取倒Y color后面的数字?
我看源程序里用下面的命令,但是始终给我抓的是0..
还有我哪个$WORKDIR能这么用嘛?
Y=`awk '/Y color/ {print int($4)}' $WORKDIR/Ycolour`
echo $Y
m*****2
发帖数: 9
2
来自主题: Programming版 - foreach statement 使用
需要对目录下的每一个压缩数据文件执行一些操作,我用的是foreach语句,但是系统
报错,"foreach too few arguments". 哪为NN给解释一下?
foreach FILE ($WORKDIR/*.dat.gz)
blablabla
end
X****r
发帖数: 3557
3
来自主题: Programming版 - foreach statement 使用
This should work -- I suspect you have quotation issue.
Did you type it from the command line, or you put them
inside a script file? If for the latter, did you start
the file with #!/bin/csh or something like that?
Also, print out the result of
echo $WORKDIR/*.dat.gz
to see if there is any special character in file names.
(共0页)