SCMLife.com

 找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 4507|回复: 0

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

[复制链接]
发表于 2015-11-18 15:34:59 | 显示全部楼层 |阅读模式
#!/bin/bash
0 r( s: W/ ^3 ^. L8 becho -n "please input login:". V9 P& Z5 |6 ]/ v7 s
read name
0 a- A1 G: q4 C* J2 Y( \  lecho -n "please input passwd:": Y! }! B# {' _3 A# L5 K8 _5 g
read passwd0 O5 `& U6 L, _: x# A! c
if[$name="test" -a $passwd="123456"];then
7 Q& p6 x7 j* A. A  echo "the rignt!") ~+ a8 P& n- M0 X) {8 D
else
' R* |$ N" e  o; N9 M  k5 H  echo "wrong!"
! Q$ f3 r" G2 Vfi: ~/ P' w7 g3 G; G* m
报错:- d/ i1 y% X5 Y4 t1 z7 [# V
login.sh: line 6: syntax error near unexpected token `then'
' V4 w2 G5 e# ylogin.sh: line 6: `if[$name="angela";$passwd="123456"];then'
8 _. N0 x3 s( o: j- C$ A
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

SCMLife推荐上一条 /4 下一条

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

GMT+8, 2019-2-19 18:02 , Processed in 0.054827 second(s), 7 queries , Gzip On, MemCache On.

Powered by SCMLife X3.4 Licensed

© 2001-2017 JoyShare.

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