Results 1 to 4 of 4
Hello,
We are using RedHat Advanced Server 3 in order to run batch jobs.
We are used to edit our scripts using Editors in our Personnal PC (windows xp) and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-25-2007 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 1
Scripts are not working after FTP from windows
Hello,
We are using RedHat Advanced Server 3 in order to run batch jobs.
We are used to edit our scripts using Editors in our Personnal PC (windows xp) and copy them to the linux using FTP.
The problem is that after copying the scripts (CSH scripts) they are not running unless we are creating new empty file and copy paste the content of them from the original file.
Our Linux administrator did not succeed to solve this problem.
In previous versions of the Linux we have no such problem - The scripts are working just fine after FTP from windows
Any idea how to solve the problem ?
Thanks in advanced,
-Koby
- 10-25-2007 #2
- 10-28-2007 #3
Files created or edited on Windows will have a carriage return
and line feed (CR/LF) at the end of each line of text.
Files created on UNIX/Linux will have only the line feed, also
known as newline character. The shell is probably choking
on the CR/LF
You should be able to convert the files with the dos2unix
command. dos2unix <filename>.
If you don't have dos2unix, look for fromdos
- 10-28-2007 #4Or use awk to fix it:
Originally Posted by rcgreen
-------------------Code:awk '{ sub("\r$", ""); print; }' script_here > script_fixed_here
Make sure the ftp clients are doing ascii transfers, and the operation should remove the carriage returns for you. (Binary transfers won't.)


Reply With Quote
