当前位置: 技术问答>linux和unix
shell的一个小问题,送分!!!来者有分(小分),解决问题的送大分
来源: 互联网 发布时间:2015-12-30
本文导语: #!/bin/sh read -p "Enter a password:" pwd_entered echo Your typed in :$pwd_entered if [$pwd_entered="passwd"] then echo Password is correct else echo Password is incorrect if 运行SHELL Enter a password:password Your typed in :password ...
#!/bin/sh
read -p "Enter a password:" pwd_entered
echo Your typed in :$pwd_entered
if [$pwd_entered="passwd"]
then
echo Password is correct
else
echo Password is incorrect
if
运行SHELL
Enter a password:password
Your typed in :password
./if_eg.sh: line 7:[password=password]:command not found
Password is incorrect
请问改怎么改啊?
read -p "Enter a password:" pwd_entered
echo Your typed in :$pwd_entered
if [$pwd_entered="passwd"]
then
echo Password is correct
else
echo Password is incorrect
if
运行SHELL
Enter a password:password
Your typed in :password
./if_eg.sh: line 7:[password=password]:command not found
Password is incorrect
请问改怎么改啊?
|
if [$pwd_entered="passwd"]
这个地方 要有空格 如
if [ $pwd_entered = "passwd" ]
这个地方 要有空格 如
if [ $pwd_entered = "passwd" ]
|
送分吧!
#!/bin/sh
read -p "Enter a password:" pwd_entered
echo Your typed in :$pwd_entered
if [ $pwd_entered = "passwd" ]
then
echo Password is correct
else
echo Password is incorrect
fi
#!/bin/sh
read -p "Enter a password:" pwd_entered
echo Your typed in :$pwd_entered
if [ $pwd_entered = "passwd" ]
then
echo Password is correct
else
echo Password is incorrect
fi
|
不可能吧
|
up
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。