Forum Moderators: coopster & phranque

Message Too Old, No Replies

Problem with shell command on perl script

tr -d \\r < dosfile > newfile

         

hehe_hehe

4:35 pm on Aug 12, 2006 (gmt 0)

10+ Year Member



i need your help..

when i try to insert shell command on my perl script, my shell command doesnt work..
in this case, i would try to remove ^M character in temp.txt with command "tr -d \\r < temp.txt > temp1.txt"

i put this script on my perl script

$cmd = "/usr/bin/tr -d \\r < temp.txt > temp1.txt";
system $cmd;

but it doesnt work... 'coz there were still ^M character in temp1.txt
besides,when i execute "tr -d \\r < temp.txt > temp1.txt" in shell,it works....
the ^M character in temp1.txt is gone...

can you help me...?
thanks before

coopster

9:17 pm on Aug 19, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, hehe_hehe.

Are you sure you aren't bumping into some form of permissions issue? Have you checked for any errors?