SCMLife.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 5009|回复: 0

[Shell] 模拟登录报错,求帮助

[复制链接]
发表于 2015-11-18 15:34:59 | 显示全部楼层 |阅读模式
#!/bin/bash8 O$ r0 U% W+ y' U
echo -n "please input login:"1 Q9 \: O# U, H3 a
read name5 d/ V# F& x$ @# u3 }
echo -n "please input passwd:"
, q0 n9 n. U4 r+ S; ?6 Jread passwd
3 h3 j; J  D, m3 q" Xif[$name="test" -a $passwd="123456"];then
* ^' y: a0 _( F# a  T2 `" U: k  echo "the rignt!"
+ ?+ ?  H0 x1 U9 n else ( n6 L/ P2 t$ w: k& ]$ l7 B: t
  echo "wrong!"
. A, x3 e- T0 v. C+ nfi0 }0 {* f; M& w: ?- b/ E. d, V* t9 f
报错:
/ Z5 G6 j6 L$ C& @7 u" p+ Plogin.sh: line 6: syntax error near unexpected token `then'
0 q2 u+ T: p, ^5 [% B6 A6 \5 r- n' ?login.sh: line 6: `if[$name="angela";$passwd="123456"];then'7 R/ `3 J, A  E& h0 ?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

SCMLife推荐上一条 /4 下一条

QQ|小黑屋|手机版|无图版|SCMLife.com ( 京ICP备06056490号-1 )

GMT+8, 2019-10-16 08:59 , Processed in 0.056530 second(s), 6 queries , Gzip On, MemCache On.

Powered by SCMLife X3.4 Licensed

© 2001-2017 JoyShare.

快速回复 返回顶部 返回列表