i have shell script written in RedHat OS. I need to run this script in windows environemtn.
So i used cygwin to run the script on windows.
But when i run the script using
sh housekeeper.sh
it gives me following error which is not retured in RedHat OS
line 12: $'\r': command not found
but line number 12 of my script is empty
08 #
09 ######################################################################
10 #### PARAMETERS TO SET BEGIN
11 ######################################################################
12
13 # archive setttings
14 ARCHIVE_USER=abc # archive storage user name (default)
15 ARCHIVE_GROUP=app # archive storage user group (default)
16 ARCHIVE_PATH=/test/file # archive storage directory (default)
17 ARCHIVE_DELAY=+8
could anybody tell me whats wrong with the script here or cygwin here.
thanks in advance for any help
Most likely cygwin
shis expecting a UNIX line separator (i.e.\n) but is instead finding a Windows line separator,\r\n, and hence is trying to execute\ras if it were a command. This could easily have happened if you edited this script in a Windows-based text editor.If you have the command
dos2unixyou could use that, ortrto remove\rs: