View Single Post
  #4 (permalink)  
Old 05-07-2009, 07:42 PM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash and Python
Posts: 2,710
Thanks: 11
Thanked 245 Times in 184 Posts
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by chimu View Post
Hmm.. what about just saving stderr and ignoring output (stdout)? I'm not interested in output but just wanted error messages.
Try to get both stdout and stderr:
Code:
 var=$(cmd1 2>&1)
Just get stderr but send stdout to /dev/null
Code:
var=$(cmd1 2>&1 >/dev/null)
__________________
Vivek Gite
Linux Evangelist
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Always use CODE tags for posting system output and commands!
Do you run a Linux? Let's face it, you need help
Reply With Quote
The Following User Says Thank You to nixcraft For This Useful Post:
chimu (05-07-2009)