0
下追加不相关的文件名我需要打印文件的最后一行例如/路径/文件,以一个参数为什么输出到变量的文件在路径
内容:
>tail -n 1 /path/file
74.870 534.1 2187.7 0.000 60.0 32047 5.782 716.573 **
从命令行的输出是正确的。
但是当我使用:
arg=`tail -n 1 /path/file`
or arg=$(tail -n 1 /path/file)
echo $arg
输出成为
74.870 534.1 2187.7 0.000 60.0 32047 5.782 716.573 file1 file2 file3 ....
file1 file2 file3 are under /path
似乎**被翻译成类似ls
? 我不太明白意思...
我怎么能得到正确的$ arg在这里?
谢谢!
问题解决了!非常感谢! – cynkiller