我是Bash脚本的新手。我运行在Ubuntu下面这个简单的脚本:Ubuntu Bash无法理解的Bash脚本
sudo bash -x Script.sh
输出:
+ $'\r'
: command not found
+ $'\r'
: command not found
+ $'\r'
: command not found
+ adminEmail=$'[email protected]\r'
+ $'\r'
: command not found
' echo 'database name:
database name:
+ read $'dbname\r'
实际的脚本:
#!/bin/bash
# Installation script for latest Wordpress website on Ubuntu
#
# Kave
# December 27, 2011
adminEmail="[email protected]"
echo "database name:"
read dbname
这都是什么'\r'
错误消息来了?即使评论似乎不被理解......
看起来你有行尾问题,但我不知道如何解决这个问题? – evotopid 2011-12-27 18:46:37
这对我的作品...拱Linux i686 – Paul 2011-12-27 18:46:57
从命令行执行'dos2unix scriptname scriptname'。 '\ r'是回车符,你是在Windows机器上创建文件并发送给linux的? – 2011-12-27 18:49:20