LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 07-31-2014, 05:02 AM   #1
maitree@123
LQ Newbie
 
Registered: Sep 2013
Posts: 7

Rep: Reputation: Disabled
Diff File contents while reading using "cat" and "more"


Hello,

I wanted to redirect colour font to output file in BASH shell (AIX OS).
But when I am trying to read the file using "cat" the output is showing in desired colour but while I am reading the file in more the output is coming in default white font.

Pls explain how can I resolve the issue.
 
Old 07-31-2014, 08:00 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,836

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I have no idea what is the issue to solve and what could be the solution.
 
1 members found this post helpful.
Old 07-31-2014, 08:09 AM   #3
maitree@123
LQ Newbie
 
Registered: Sep 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Let me explain you :-

Suppose

GREEN='\033[00;32m'

I want to redirect the content of the output to a file which will have the font with GREEN colour.

$ echo "$GREEN Hello2 $NONE" >tmp.txt
$ cat tmp.txt
Hello2

When I opening the file using cat command the font of the content of tmp.txt file (i,e; Hello2) is coming in GREEN colour but if I open the file in more command it is not reflecting the desired colour.

Hope you understand the issue now.

Last edited by maitree@123; 07-31-2014 at 08:10 AM.
 
Old 07-31-2014, 08:59 AM   #4
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,862
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
True. AIX!more doesn't display ESC directly:

Code:
$ more green.txt
^[[32mGreen^[[m
Use option -v:

Code:
$ more -v green.txt
Green

Last edited by NevemTeve; 07-31-2014 at 09:20 AM. Reason: 31->32 (I have R/G color-blindness)
 
  


Reply

Tags
color



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
how can I "cat" or "grep" a file to ignore lines starting with "#" ??? callagga Linux - Newbie 7 08-16-2013 06:58 AM
unpredictable "delete" "move to trash" or "cut" file menu option dorianrenato Linux - General 3 11-28-2011 06:41 PM
script using "/usr/bin/cat error" produces "cannot open" in cron Dcrusoe Programming 6 07-22-2009 03:30 PM
Feeding the output of "diff" or "cat" command to dpkg --purge kushalkoolwal Debian 9 06-19-2008 07:27 AM
K3b: - Howto re-dock "Directories" and "Contents" windows back into the main window? hagies Linux - Software 4 04-26-2006 08:38 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

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