Link to home
Start Free TrialLog in
Avatar of Iwan Tamimi
Iwan TamimiFlag for Singapore

asked on

ls running on job scheduler gives a strange character

I have a script on RedHat 6.2 Enterprise Linux contains a simple command as "ls -la > output.txt" if I run the script direct from the terminal the result was OK (the script is a ksh script). The problem if I run from the job scheduler (I am using Hitachi JP/1), the output file contained strange character. I am thinking it is because of the color code, but I tried everything with the same result.
I tried the following commands on the script:
unalias ls
ls -la /tmp/ > /tmp/test_ls_la.txt
/bin/ls -la /tmp > /tmp/test_bin_ls.txt
\ls -la /tmp > /tmp/test_bs.txt
/bin/ls -la --color=none /tmp > /tmp/test_ls_nocolor.txt


all the command above give me the same result:
-rw-r--r-- 1 dmoopr produsers 601071  4æ 18 15:05 2012 /dmo03/dmotmp/prod/tmp/M1dmo/L_HWIMS1_201204181410_2571
-rw-r--r-- 1 dmoopr produsers 255743  4æ 18 15:05 2012 /dmo03/dmotmp/prod/tmp/M1dmo/L_HWIMS1_201204181410_2572

As you can see there is 4æ character.  

Anyone knows how to solve it?

Thank you,

Iwan Tamimi
ASKER CERTIFIED SOLUTION
Avatar of bazika
bazika
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Iwan Tamimi

ASKER

Thank you very much it solves my problem,

Iwan