例如
ssh root@me -- cat /etc/hostname -- cat /etc/hostname
我期望它的输出:
me
me
但它的输出
me
me
cat: cat: No such file or directory
我知道双破折号意味着结束解析选项,为什么它会引发cat: cat: No such file or directory。
管道的正式定义是左文件的STDOUT将立即管道到右侧文件的STDIN,我有两个文件,hello.txt和human.txt。cat hello.txt返回Hello,cat human.txt返回I am human.Now,如果我做了cat hello.txt | cat human.txt,难道不应该返回Hello I am human吗?相反,我看到command not found.I新来shell scripting.Can,有人解释了吗?
我肯定有人问过这个问题,但我的搜索没有结果。
我想运行3个bash命令,如果第一个命令成功的话,只运行第二个和第三个命令。
示例:
## Setup
mkdir so_test_tmp && cd so_test_tmp
echo "This is something" > something
cd ..
## Example commands
cd so_test_tmp ??? cat nothing ??? cd .. # 0.
cd so_test_tmp ??? cat something ??? cd .. # 1.
cd does_
在我们的-r企业7.MAIPO(?)上搜索无效选项cat命令服务器,但没有运气。
尝试读取具有完整路径的文件名列表,打开filelist.log中列出的文件,并将该文件的内容附加到一个大文件中。
例如,如果filelist.log有一个由五个文件名及其完整路径组成的列表:
1st file in the list consists of 10 lines.
2nd file in list is 4 lines.