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:
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?