hidden characters added to commands

Hello everybody.

Im really new in shell scripting. Im working with RedHat 4.

I have begin to do some scripts to test the posibilitys but Im fancing a disturbing problem.

some times the lines that I write add the return character or end-of-file ascii character to the command or argument tha I write, result of this : the interpreter display error or bad execute command.

By example :
The first line #!/bin/sh
give me the next error #/bin/sh^M

Other, this command cp /pathname/$1 /pathname/$2, write the filename with a \r like last character of $2

Im using vi like text editor.

Any help wellcome.
Thanks in advanced.
Regards to all.

see the dos2unix command. you can avoid this by transfering files to the server in ascii mode.

1 Like

it work, thanks again