Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
syntax:ccmd:grouping_subshell [2010/04/15 17:43]
127.0.0.1 external edit
syntax:ccmd:grouping_subshell [2013/01/14 19:21] (current)
ormaaj expand
Line 12: Line 12:
 ===== Examples ===== ===== Examples =====
  
 +Execute a command in a different directory.
 +<code bash>
 +echo "​$PWD"​
 +( cd /usr; echo "​$PWD"​ )
 +echo "​$PWD"​ # Still in the original directory.
 +</​code>​
  
 ===== Portability considerations ===== ===== Portability considerations =====
  
 +  * The subshell compound command is specified by POSIX.
 +  * Avoid ambiguous syntax.
 +<code bash>
 +(((1+1))) # Equivalent to: (( (1+1) ))
 +</​code>​
  
 ===== See also ===== ===== See also =====
   * [[syntax:​ccmd:​grouping_plain | grouping commands]]   * [[syntax:​ccmd:​grouping_plain | grouping commands]]
 +  * [[http://​mywiki.wooledge.org/​SubShell | Subshells on Greycat'​s wiki]]
  
  • syntax/ccmd/grouping_subshell.1271353422.txt
  • Last modified: 2013/01/14 19:21
  • (external edit)