SCMLife.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 3909|回复: 0

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

[复制链接]
发表于 2015-11-18 15:34:59 | 显示全部楼层 |阅读模式
#!/bin/bash) |, e" Q2 G. s. P" q3 O
echo -n "please input login:"6 B; E# f, U7 V
read name
4 Y8 L! Q# o& Y" c$ }echo -n "please input passwd:"$ b6 Y5 G9 {0 i, z+ ~; X* H; i
read passwd
/ U8 i' r+ q5 z( V( Yif[$name="test" -a $passwd="123456"];then
# O, w7 q4 C* y* Q2 E1 W9 F- E5 a  echo "the rignt!"' K6 K0 u5 _6 m* I# |: b
else
4 t0 v7 U3 ]8 E: f  echo "wrong!"( V" h% O  }6 I4 D* [
fi+ m, U. z# M0 }
报错:) m2 Q; Z$ r  x* D! c7 O
login.sh: line 6: syntax error near unexpected token `then'
; K0 G7 a# P; ?* A2 Ylogin.sh: line 6: `if[$name="angela";$passwd="123456"];then'* p$ b2 K( P- P5 X; D  p
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

SCMLife推荐上一条 /4 下一条

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

GMT+8, 2018-9-25 23:51 , Processed in 0.055650 second(s), 6 queries , Gzip On, MemCache On.

Powered by SCMLife X3.4 Licensed

© 2001-2017 JoyShare.

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