SCMLife.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 4225|回复: 0

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

[复制链接]
发表于 2015-11-18 15:34:59 | 显示全部楼层 |阅读模式
#!/bin/bash
* l% o; L2 @0 f8 u! p+ cecho -n "please input login:"
9 y8 H' r1 k6 c$ L5 lread name
1 y% W  H- z2 a0 P$ F: `) m+ Vecho -n "please input passwd:"
$ S1 \  J1 X, ]read passwd' A$ X  {+ R* G0 s
if[$name="test" -a $passwd="123456"];then
# C5 G5 k  f! l3 i( K( n% k* B9 K  echo "the rignt!"
/ }- S' @% y& ^; q* ^  S% |& _ else ' |& {  g7 C8 \+ L* o
  echo "wrong!"+ m# U0 R2 ^, H+ Z5 G
fi
$ Y  m* R& A1 z( L- A! d2 z报错:2 M& {' ]6 h' _6 i! m( `$ D5 R
login.sh: line 6: syntax error near unexpected token `then'; ^; h5 V. [2 Y1 l/ R
login.sh: line 6: `if[$name="angela";$passwd="123456"];then'2 V5 ^! e3 N9 u8 K9 b8 |& v7 w
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

SCMLife推荐上一条 /4 下一条

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

GMT+8, 2018-12-17 14:14 , Processed in 0.167345 second(s), 6 queries , Gzip On, MemCache On.

Powered by SCMLife X3.4 Licensed

© 2001-2017 JoyShare.

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