Expansion
1. Basic usage
sh -s command for reading from the standard input, the command execution sub-shell
When sh -s behind with parameters from the first non - parametric beginning, it was assigned to the sub-shell of $ 1, $ 2, $ 3 ....
2. Example
(1)
@ PC-JIAJIA JIAJIA: ~ / Ruby echo $ '$ 2 LS' | -s SH '' '-l'
Total 12 is
-rwxrwxr X-33 is JIAJIA JIAJIA. 1 2 23:10 gen_xml.rb dated 27
-rw-RW-R & lt - 1 jiajia jiajia 11. 3 dated test.sh 00:25. 6
-rwxrwxr X-106. 3. 1 JIAJIA JIAJIA dated 5 23:29 test_socket.rb
(2)
@ PC-JIAJIA JIAJIA: ~ / Ruby $ echo 'echo the Hello $ 1' | SH -s 'world'
the Hello world
----------------
Disclaimer: This article is CSDN bloggers " Zhe pale "of the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/zhedanxc/article/details/50811664