Timeline for Why doesn't echo called as /bin/sh -c echo foo output anything?
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 17, 2020 at 10:51 | comment | added | Subhajit | @IjazAhmadKhan what if I want to execute some command with sh -c something like this: sh -c test.py arg1 arg2 arg3 ? Secondly what if arg3 contains something like "/export/local/repo/ab#cd.rpm" , how can I handle # in this case ? | |
| Jan 26, 2017 at 12:28 | history | edited | Stéphane Chazelas | CC BY-SA 3.0 | added 4 characters in body |
| Jan 7, 2016 at 8:49 | vote | accept | SilverlightFox | ||
| S Jan 5, 2016 at 19:57 | history | suggested | user46212 | CC BY-SA 3.0 | Format man page text to not wrap. Syntax hint none ofr man page text. Add shell prompt to indicate written command. |
| Jan 5, 2016 at 19:54 | review | Suggested edits | |||
| S Jan 5, 2016 at 19:57 | |||||
| Jan 5, 2016 at 18:18 | comment | added | Ijaz Ahmad | @ X3MBoy The questioner already know that /bin/sh -c 'echo foo' works fine. He wanted to echo something outside that , which i explained | |
| Jan 5, 2016 at 18:01 | comment | added | X3MBoy | IMHO the explanation was quite good, but sh -c 'echo $0' foo is not the best option, taking into account that the questioner already know that /bin/sh -c 'echo foo; echo bar' works, you can simply answer quoting the command /bin/sh -c 'echo foo' | |
| Jan 5, 2016 at 17:43 | comment | added | zwol | sh -c 'echo "$@"' fnord a b c d ... | |
| Jan 5, 2016 at 16:38 | history | edited | Ijaz Ahmad | CC BY-SA 3.0 | deleted 2 characters in body |
| Jan 5, 2016 at 16:33 | history | edited | Ijaz Ahmad | CC BY-SA 3.0 | deleted 2 characters in body |
| Jan 5, 2016 at 16:33 | comment | added | jlliagre | A stricter, standard conformant way would be sh -c 'echo $1' echo foo | |
| Jan 5, 2016 at 16:30 | history | answered | Ijaz Ahmad | CC BY-SA 3.0 |