LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-12-2010, 01:51 AM   #1
kma07
LQ Newbie
 
Registered: May 2010
Posts: 6

Rep: Reputation: 0
Redirection output


Hi there

I have a perl script that runs but it outputs everything onto the screen instead of a file.

I've tried using "myscript > outputfile.txt" however all it does is dump the output to the screen and creates an outputfile.txt but doesn't put anything in that file.

Any help would be appreciated

Thanks in advance!
 
Old 05-12-2010, 02:15 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
Perhaps the script is writing to stderr. In bash, the &> redirect will catch output to both stderr and stdout. Explicitly, try:

Code:
./myscript &> outputfile.txt
 
Old 05-12-2010, 09:17 PM   #3
kma07
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
problem solved
thanks
 
Old 05-12-2010, 11:13 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,250

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Quote:
problem solved
Then please mark it as SOLVED
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Output / Redirection VauxhallVXR Programming 2 06-06-2009 06:10 PM
Output Redirection - Trying to output to screen and file? helptonewbie Linux - Newbie 7 03-19-2009 08:05 AM
output redirection lons Linux - General 4 03-13-2007 01:31 AM
Output redirection??? ed_po Linux - Newbie 3 06-13-2006 01:17 PM
Output redirection rmartine Linux - Newbie 2 01-25-2005 07:31 PM


All times are GMT -5. The time now is 04:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration