LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-17-2013, 02:13 AM   #1
relwe
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Rep: Reputation: Disabled
redirect results to file


I want to redirect this:
Unloading HCA driver: [ OK ]
Loading HCA driver and Access Layer: [ OK ]
Setting up InfiniBand network interfaces:
Error adding address 11.7.5.129 for ib0.
Bringing up interface ib0: [ OK ]
Bringing up interface ib1: [ OK ]
No configuration found for ib2
Bringing up interface ib3: [ OK ]
Setting up service network . . . [ done ]

to a file but when I'm doing this the [ OK ] and [ done ] look weird in the file. Is there an option to do it normally?
Thx.
 
Old 10-17-2013, 02:16 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273Reputation: 2273
the most simple way probably to filter it with cat:
<commands or script> | cat > write_to_file
 
Old 10-17-2013, 04:23 AM   #3
relwe
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks but it didn't help.
 
Old 10-17-2013, 04:40 AM   #4
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
Quote:
Originally Posted by relwe View Post
I want to redirect this:
Unloading HCA driver: [ OK ]
Loading HCA driver and Access Layer: [ OK ]
Setting up InfiniBand network interfaces:
Error adding address 11.7.5.129 for ib0.
Bringing up interface ib0: [ OK ]
Bringing up interface ib1: [ OK ]
No configuration found for ib2
Bringing up interface ib3: [ OK ]
Setting up service network . . . [ done ]

to a file but when I'm doing this the [ OK ] and [ done ] look weird in the file. Is there an option to do it normally?
Thx.
It looks like linux boot time messages when the kernel loads and it start services. If yes, Why did you need this to be redirected to separate file while linux already has a log location setup for bootup messages ?

Code:
dmesg
/var/log/boot.*
are some of the examples to look into.

**NOTE: unless something is a kernel driver or parameter it wouldnt show in "dmesg".
 
Old 10-17-2013, 07:09 AM   #5
relwe
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
It is not linux boot time log, it is something else.
 
Old 10-17-2013, 08:14 AM   #6
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
Often messages like these have colored output for things like [OK] or [done]. The terminal wouldn't display the color-codes, but change the colors. This is of course not possible in a text file, so the color-codes are also logged. The solution would be to adapt your scripts, so that they don't use colored output.
 
  


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
File is there, but attempted execution results in: No such file or directory Satan's_Little_Helper Linux - Newbie 5 09-01-2011 10:40 PM
[SOLVED] sqlplus query results with spool file go to display and file steven.c.banks Linux - General 2 06-06-2011 04:13 PM
Apache redirect results in endless loop jnojr Linux - Software 3 03-25-2009 09:14 PM
forcing https redirect results in forbidden? sneakyimp Linux - Software 11 10-22-2007 04:11 AM
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 09:10 AM


All times are GMT -5. The time now is 02:35 AM.

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