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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Redirect output mpang_ Shell Programming and Scripting 1 08-15-2007 05:57 AM
how to redirect my output in a new terminal Sayantan SUN Solaris 0 06-29-2007 03:01 AM
redirect output of FTP kcaluwae Shell Programming and Scripting 4 06-23-2005 05:45 AM
redirect command output to variable hugow UNIX for Dummies Questions & Answers 1 06-22-2005 03:43 AM
Is there a linux version of dos2unix command? kymberm UNIX for Dummies Questions & Answers 4 05-29-2003 09:33 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-25-2008
Registered User
 

Join Date: Dec 2007
Posts: 11
redirect output of dos2unix command

hi

I want to suppress the output of dos2unix command in my shell script. I'm using follwing command in my script

dos2unix somefile >/dev/null

But it's still showing output while executing the script.Please help me to sort this out

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 01-25-2008
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,616
I can't reproduce this...
Code:
$ dos2unix data
ISD=977155185403901+DIE CAST+DIE CAST 055555+01087+001008+SPR 08+08+004+Y'
ISD=977155185403901+DIE CAST+DIE CAST?+55555+01087+001008+SPR 08+08+004+Y'
$ dos2unix data > /dev/null
$
Maybe something else is causing the output, not dos2unix. But if you discard the output from dos2unix, why run it at all? It will have no effect except to waste time.
Reply With Quote
  #3  
Old 01-25-2008
Registered User
 

Join Date: Dec 2005
Posts: 74
id it is an error then
use
2>/dev/null
Reply With Quote
  #4  
Old 01-25-2008
Registered User
 

Join Date: Jan 2008
Location: Bangalooru
Posts: 15
hi

Quote:
Originally Posted by nrbhole View Post
hi

I want to suppress the output of dos2unix command in my shell script. I'm using follwing command in my script

dos2unix somefile >/dev/null

But it's still showing output while executing the script.Please help me to sort this out

Thanks

hope u want to see only errors not exectued onces right???
try this
dos2uix folder/*.* > text

folder which contains files need for conversion.
this should work.
Reply With Quote
  #5  
Old 01-25-2008
Registered User
 

Join Date: Dec 2007
Posts: 11
Hello friends,

Thanks for your reply.
I tried for dos2uix folder/*.* > text, 2>/dev/null, but none of them worked

Actually it's not error. I need to avoid output like.
dos2unix: converting file hosting-network-and-datacenter.html to UNIX format ...
My code is given below
Quote:
function file_mod()
{
echo "Removing Blank Spaces.."
dos2unix $1>/dev/null
sed -i '/^$/d' $1
}
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0