The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
passing variable from bash to perl from bash script arsidh Shell Programming and Scripting 10 06-04-2008 01:25 PM
Why generate "ash and bash" different output for same bash script? s. murat Shell Programming and Scripting 0 05-26-2008 08:19 AM
processing tab-formated output of command w/bash sweede Shell Programming and Scripting 2 05-23-2008 10:17 PM
bash:awk output into an array phamp008 Shell Programming and Scripting 2 03-16-2008 05:14 AM
Bash multiple output redirection yoi2hot4ya Shell Programming and Scripting 2 05-31-2005 01:52 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-13-2008
alirezan alirezan is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 22
Bash script undesired output

hi guys,

When for example, I want to get the size of a partition, I have done the following:

# result=`fdisk -l | grep /dev/sda1`
# echo $result
/dev/sda1 1 15000 120487468+ 83 Linux

and then I parse this output to get the size. That's just fine. The problem here is that, when I have a disk that does not have a good filesystem on it, it shows:

# result=`fdisk -l | grep /dev/sda1`
Disk /dev/hdd doesn't contain a valid partition table
#

I don't want to see that error message. I just want to turn it off. How can I do that?

By the way, I have tried redirecting to /dev/null, but no luck!

Thanks

Last edited by alirezan; 08-13-2008 at 08:42 PM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0