我有用RedHat操作系统编写的shell脚本。我需要在windows environemtn中运行这个脚本。在windows操作系统上用linux编写的运行Shell脚本
所以我使用cygwin在Windows上运行脚本。
但是当我运行使用
sh housekeeper.sh
它给了我下面的错误未在RedHat的OS retured脚本
line 12: $'\r': command not found
,但我的脚本的行数12为空
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
有人可以告诉我这里的脚本或cygwin在这里有什么问题。
在此先感谢您的帮助
如果剧本中某处有显着的回车,这比tr更安全:'sed's/\ r $ //'' –