开发者

how to read rows?

开发者 https://www.devze.com 2023-01-01 09:57 出处:网络
I\'m trying to read first row from t开发者_Go百科he file > source ./rank file using this script

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

精彩评论

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

关注公众号