Visit Our UNIX and Linux User Community


Some Junk contents.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Some Junk contents.
# 1  
Old 06-03-2009
Some Junk contents.

Hai Masters,

When i m trying to do comparing some 600 files of filename and size from server 1 with same from server 2.

Server1:
You when i m trying to do the following cmd.
ls -lrt | awk '{ print $5,$9}' >arr.sql.
This will print the filename & size of all the files in to file named "arr.sql"

What the problem is..

When i am trying to view the arr.sql, it seems like
3047 ^[[00mupgrade_9_1_0_to_9_2_0_ccex.sql^[[00m
12288 ^[[01;34mprocesses^[[00m
12288 ^[[01;34munix920b01^[[00m
4096 ^[[01;34mCVS^[[00m
108 0 ^[[00marr.sql^[[00m

But at the same time, the o/p of following cmd seems like
cat arr.sql
3047 upgrade_9_1_0_to_9_2_0_ccex.sql
12288 processes
12288 unix920b01
4096 CVS
108 arr.sql
Wt abt the some junk contents..Why bcz this pbm happens
Could anyone suggest some ideas on this.
Your help would much appreciate!!
# 2  
Old 06-03-2009
If you are viewing the file in vi, ^[ is a representation of the character escape (ESC, 0x1b) and ESC[01;34 is a terminal command to change the color.

You have an ls command that is doing colored output.
When ls is piped like ls -lrt | awk it should not use colors.
# 3  
Old 06-03-2009
Hai colemar.

Thank you dear..
Yes, Ur suggession is really solves my problem..
Do well..

Previous Thread | Next Thread
Test Your Knowledge in Computers #147
Difficulty: Easy
Linus Torvalds released the Linux kernel as free software under the GNU General Public License in 1991.
True or False?

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If contents of A are in B then move the common contents to C

Hallo Team, I have 2 .csv files file A has 47600 lines and file B has 67000 lines FILEA SD0o9rb01-1d320ddbcc8d220f572739ebed5f58d1-v300g00 SD8bt0101-a0810bfe0e3396060126ec51b30dac0a-v300g00 SD05sce01-cb056af347ed4651f29eb3c3e9addbd6-v300g00... (3 Replies)
Discussion started by: kekanap
3 Replies

2. Shell Programming and Scripting

Junk email

Hello, I am using a mailing statement in unix as follows echo " Files are available at the designated FTP folder location \n \n $(ls *)"| mailx -m -s " files are available" X@y.com But email is going to my junk folder instaed inbox. Can anyone pls advise..I need to get my email to... (1 Reply)
Discussion started by: harika03
1 Replies

3. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

4. Shell Programming and Scripting

finding junk characters

Hi, Is there anyway to find the junk characters in a file.Consider the file has data as given below: 123|abc^M|Doctor^C #record 1 234|def|Med #record 2 345|dfg^C|Wrong^V #record 3 The junk characters are highlighted and this is a pipe delimited file. Is there anyway to... (20 Replies)
Discussion started by: ashwin3086
20 Replies

5. Shell Programming and Scripting

More Junk

............................................ ............................................ (0 Replies)
Discussion started by: hrachG
0 Replies

Featured Tech Videos