-2
A
回答
6
bash -c '...'
留下您的選擇提供標準輸入輸入命令,而
bash <<<'...'
排除了選擇,因爲標準輸入已被使用,以提供腳本來執行。
例子:
# Executes the `ls` command then processes stdin input via `cat`
echo hi | bash -c 'ls -d /; cat -n'
/
1 hi
# The here-string input takes precedence and pipeline input is ignored.
# The `ls` command executes as expected, but `cat` has nothing to read,
# since all stdin input (from the here-string) has already been consumed.
echo hi | bash <<<'ls -d /; cat -n'
/
相關問題
- 1. 什麼是Concat的在C字符串++,並使用系統
- 2. 什麼是C#字符串
- 3. 爲什麼在C++中使用c字符串?
- 4. 此字符串的格式是什麼?
- 5. 什麼是在C#中分割此字符串的好方法?
- 6. 你什麼時候使用字符串而不是字符?
- 7. 在C++中使用字符串資源有什麼意義?
- 8. C:爲什麼不能在scanf()函數中使用字符串?
- 9. 爲什麼在Objective-C的字符串之前使用'@'?
- 10. 我可以在C字符串中使用什麼值?
- 11. 什麼是「&=」運算符?爲什麼Twilio在比較字符串時使用它?
- 12. 在C#中的區別是什麼:字符串VS字符串
- 13. uwsgi使用什麼__name__字符串?
- 14. 使用什麼Python urrlib user_agent字符串?
- 15. 什麼連接字符串使用SSIS
- 16. C++ _bstr_t而不是使用字符串
- 17. 使用bash加密字符串
- 18. 使用字符串作爲bash腳本
- 19. 使用bash提取子字符串
- 20. 使用scala.sys.process執行bash字符串
- 21. 如何使用bash替換字符串
- 22. C的「char」使用什麼字符集?
- 23. 字符串使用C
- 24. 置字符串使用C
- 25. C++使用字符串
- 26. c#使用字符串
- 27. C++爲什麼在教程中使用有關字符串的字符數組?
- 28. C# - 什麼是從字符串
- 29. C#中字符串前的@是什麼?
- 30. 什麼是「捆綁」的bash中使用
的好處是不必重定向與'bash的-c'一切... –
你這是什麼意思呢? – yosefrow
'<<<'(這裏是字符串)和重定向,這就是我的意思。 –