a***u 发帖数: 14 | 1 我想把(cat filename | grep "^...")的东东赋值给i,再判断i是否有东西,该怎么做呀
? | p******f 发帖数: 162 | 2
i='grep "..." filename'
if test -n $i; then
...
fi
NOTE: the tick in the first line should be back-tick,
which i can't input, because it is defined as BOSS KEY by sterm.
【在 a***u 的大作中提到】 : 我想把(cat filename | grep "^...")的东东赋值给i,再判断i是否有东西,该怎么做呀 : ?
| f***y 发帖数: 98 | 3 if i=`grep "^..." filename`; then ... should be fine.
【在 p******f 的大作中提到】 : : i='grep "..." filename' : if test -n $i; then : ... : fi : NOTE: the tick in the first line should be back-tick, : which i can't input, because it is defined as BOSS KEY by sterm.
|
|