LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-13-2008, 04:11 AM   #1
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Rep: Reputation: 30
STDOUT prefix


Hi,

Quick question, I want to output all the STDOUT from a script to a log file . At the moment I run it using the standard "./scriptname >> /tmp/myfile" method.

But I also echo other scripts into this same file at the same time. Can I add a prefix in front of each line from "scriptname" so that I can destinguise what script has outputed what into /tmp/myfile?


Thanks!
 
Old 06-13-2008, 04:21 AM   #2
Fredde87
Member
 
Registered: Aug 2005
Posts: 158

Original Poster
Rep: Reputation: 30
Stupid me, realised I could do it with SED just after I posted this.


Here is a example if anyone else would need it,


./scriptname | sed 's/^/Prefix-/g' > /tmp/myfile
 
  


Reply



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
difference b/w AF_ prefix and PF_ prefix related to socket Ashok_mittal Linux - Newbie 1 03-20-2008 04:15 PM
redirecting stdout to /dev/null and stderr to stdout? Thinking Programming 1 05-18-2006 02:36 AM
Always -prefix=/usr? oneandoneis2 Linux From Scratch 5 07-28-2004 12:11 AM
Sendmail prefix mikeyt_333 Linux - Software 0 07-17-2004 02:13 PM
./configure --prefix=/??? mykrob Linux - Newbie 7 06-24-2004 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:23 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
Open Source Consulting | Domain Registration