开发者

how to read rows?

I'm trying to read first row from t开发者_Go百科he file

> source ./rank file

using this script

set line = ($<)  <- inside rank

but when I enter

echo $line I receive nothing, how can I change it? thanks in advance


Since csh is brain-dead, you'll have to do something like this:

set line = `head -n 1 filename`


It's built-in in Bash as:

read -r line < filename


set line = `cat file | sed 1q`
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜