请教下《鸟哥私房菜》中关于判断的语句“[ ]”的问题

sh/bash/dash/ksh/zsh等Shell脚本
回复
imwise
帖子: 2
注册时间: 2012-07-10 17:08

请教下《鸟哥私房菜》中关于判断的语句“[ ]”的问题

#1

帖子 imwise » 2012-07-10 17:14

在下初学linux,我想请教下《鸟哥私房菜》中关于判断的语句“[ ]”我在ubuntu11.10中总是显示“[: xx(判断语句所在行数):unexpected operator" 不知道是什么原因?希望有人可以抽出时间知道一下?谢谢了!
头像
xjpvictor
帖子: 2837
注册时间: 2007-08-22 15:55
系统: Archlinux
来自: 新加坡
联系:

Re: 请教下《鸟哥私房菜》中关于判断的语句“[ ]”的问题

#2

帖子 xjpvictor » 2012-07-10 17:24

[ ] 前后要空格
Entschuldigung. Ich habe keine ahnung.
Secure with PGP: gpg --recv-keys 0x68b6e3d8
Fingerprint: 5556 517C F52F E402 DDF5 5400 6D30 F13E 68B6 E3D8
Towards A Sustainable Earth: Print Only When Necessary
imwise
帖子: 2
注册时间: 2012-07-10 17:08

Re: 请教下《鸟哥私房菜》中关于判断的语句“[ ]”的问题

#3

帖子 imwise » 2012-07-11 11:34

xjpvictor 写了:[ ] 前后要空格
谢谢,我去试试
回复