SCMLife.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 3006|回复: 0

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

[复制链接]
发表于 2015-11-18 15:34:59 | 显示全部楼层 |阅读模式
#!/bin/bash
& o5 b" g6 ]4 d3 \7 c% jecho -n "please input login:"$ C: ~5 g0 H  t* D+ x3 T
read name( e# O* \4 n  L+ H' b7 G
echo -n "please input passwd:"( C; l& l- ^0 l' `3 A6 ~8 @+ w
read passwd# M8 I0 j% p/ R8 ^+ ]8 R; ~% t4 ?
if[$name="test" -a $passwd="123456"];then
# q4 ?6 M& g. _) [; l  echo "the rignt!"# j' [/ l% g8 |# q! F
else
6 ~5 ~+ {  t( J% P3 I: u  echo "wrong!"
! c4 v, S2 B9 o; x5 Xfi
' k& p( }' g0 x/ ]3 L0 X) ^报错:/ }. m, M/ @' y+ l
login.sh: line 6: syntax error near unexpected token `then'
* p. m* j0 D$ [# D( p7 S* Mlogin.sh: line 6: `if[$name="angela";$passwd="123456"];then'  E$ Z4 I6 l/ ^/ F
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2018-1-17 22:19 , Processed in 0.057489 second(s), 6 queries , Gzip On, MemCache On.

Powered by SCMLife X3.4 Licensed

© 2001-2017 JoyShare.

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