我从shell检查输入时遇到问题,有人可以帮助我:
#!/bin/bash
export type=$1
echo "$type"
if [$type=="kvm"]
then
echo "true"
else
echo "false"
fi
我希望shell会打印为true,但结果是:
> bash ~/my_scripts/dssh.sh kvm
kvm
/home/xdoabui/my_scripts/dssh.sh: line 15: [kvm==kvm]: command not found
false