View Single Post
  #1 (permalink)  
Old 04-07-2009, 11:40 AM
chimu's Avatar
chimu chimu is offline
Contributors
User
 
Join Date: Mar 2005
OS: Ubuntu
Posts: 79
Thanks: 23
Thanked 4 Times in 3 Posts
Rep Power: 6
chimu is on a distinguished road
Default Shell store or return output of a command in a variable

I can store command output using $(cmd) or `cmd`. But how do get stdout+stderr in a variable? Also, some script has $?
Code:
ret=$?
return $ret
ret stores $? but why?

Last edited by nixcraft; 06-07-2009 at 10:54 AM.
Reply With Quote