
{"id":16442,"date":"2016-02-22T16:35:55","date_gmt":"2016-02-22T16:35:55","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=16442"},"modified":"2016-02-22T16:35:55","modified_gmt":"2016-02-22T16:35:55","slug":"enclose-one-or-more-commands-inside-a-pair-of-parentheses","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2016\/02\/22\/enclose-one-or-more-commands-inside-a-pair-of-parentheses\/","title":{"rendered":"enclose one or more commands inside a pair of parentheses"},"content":{"rendered":"<pre>\n$ls\n1\n$( ls date )\nls: cannot access date: No such file or directory\n$( `ls` date )\nbash: 1: command not found\n$cat 1\nB$\n$( ls `date` )\nls: cannot access Mon: No such file or directory\nls: cannot access Feb: No such file or directory\nls: cannot access 22: No such file or directory\nls: cannot access 21:36:34: No such file or directory\nls: cannot access IST: No such file or directory\nls: cannot access 2016: No such file or directory\n$( `ls` `date` )\nbash: 1: command not found\n$( ls time )\nls: cannot access time: No such file or directory\n$( ls `time` )\n\nreal\t0m0.000s\nuser\t0m0.000s\nsys\t0m0.000s\n1\n$( ls pwd )\nls: cannot access pwd: No such file or directory\n$ls pwd\nls: cannot access pwd: No such file or directory\n$( ls ) ( pwd )\nbash: syntax error near unexpected token `('\n$ls date\nls: cannot access date: No such file or directory\n$`ls` date\nbash: 1: command not found\n$ls `date`\nls: cannot access Mon: No such file or directory\nls: cannot access Feb: No such file or directory\nls: cannot access 22: No such file or directory\nls: cannot access 21:41:17: No such file or directory\nls: cannot access IST: No such file or directory\nls: cannot access 2016: No such file or directory\n$ (ls  pwd )\nls: cannot access pwd: No such file or directory\n$x =1\nbash: x: command not found\n$x = 1\nbash: x: command not found\n$$x = 1\nbash: =: command not found\n$ (x = 1)\nbash: x: command not found\n$x=1\n$echo $x\n1\n$(echo $x)\n1\n$echo $x\n1\n$(x=2;echo $x)\n2\n$echo $x\n1\n$(x=2 echo $x)\n1\n$echo $x\n1\n$(x=2;echo $x)\n2\n$\n\n\nhttp:\/\/www.tldp.org\/LDP\/abs\/html\/subshells.html\nhttp:\/\/unix.stackexchange.com\/questions\/138463\/do-parentheses-really-put-the-command-in-a-subshell\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>$ls 1 $( ls date ) ls: cannot access date: No such file or directory $( `ls` date ) bash: 1: command not found $cat 1 B$ $( ls `date` ) ls: cannot access Mon: No such file or directory ls: cannot access Feb: No such file or directory ls: cannot access 22: No such &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2016\/02\/22\/enclose-one-or-more-commands-inside-a-pair-of-parentheses\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;enclose one or more commands inside a pair of parentheses&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[1510],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16442"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=16442"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16442\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=16442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=16442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=16442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}