0

I am trying to run this simple bash script:

file_name=deploy
 echo "Init File NAme $file_name"
current_time=$(date "+%Y.%m.%d-%H.%M.%S")
echo "Current Time : $current_time"

new_fileName="${file_name}${current_time}.zip"
echo "New FileName: $new_fileName"
#echo $new_fileName ./app/code/community ./app/code/local ./app/design/frontend/indigo ./app/design/frontend/default 
#zip $new_fileName ./app/code/community ./app/code/local ./app/design/frontend/indigo ./app/design/frontend/default 

But for some reason I receive:

Init File NAme deploy
Current Time : 2015.10.01-16.04.02
./ManualPack.sh: line 5: $'\r': command not found
.zip5.10.01-16.04.02

I know its very very simple to any beginner in bash, but I tried for a decent amount of time, with many Stack Overflow threads to make it work, but the output remains the same.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
James Roeiter
  • 861
  • 1
  • 9
  • 23
  • It is working fine on my linux server. Did you copy/pasted? Maybe there are some invisible characters messing with you (like `\r`). Try to write it all again by hand, no copy/paste. – Alvaro Flaño Larrondo Oct 01 '15 at 20:14

1 Answers1

1

You seem to have Windows styled line terminators in your file (\r\n). Converting the file with dos2unix should help.

Sleafar
  • 1,486
  • 8
  • 10