Linux脚本,#/bin/bash if [ $1 = cat ];then echo "dog"; elif [ $
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/08/09 05:00:09
Linux脚本,#/bin/bash if [ $1 = cat ];then echo "dog"; elif [ $1 = dog ];then
$0,其实表示的就是shell脚步文件本身的名称;
$1,表示运行shell脚步时提供的第一个参数;
$2,表示运行shell脚步时提供的第二个参数;
.
依此类推!
再问: 可以提供$0,$1,$2都存在的脚本吗,我想问的其实就是这个部分但是没说清楚,谢谢
再答: #!/bin/sh error() { echo $2 exit $1 } if [ $# -lt 4 ]; then error 1 "Invalid parameters. Usage: $0 interval(in second) endtime(time to end the sending) peer_number(peer's telephone number) SMS_context(content of SMS)" fi
$1,表示运行shell脚步时提供的第一个参数;
$2,表示运行shell脚步时提供的第二个参数;
.
依此类推!
再问: 可以提供$0,$1,$2都存在的脚本吗,我想问的其实就是这个部分但是没说清楚,谢谢
再答: #!/bin/sh error() { echo $2 exit $1 } if [ $# -lt 4 ]; then error 1 "Invalid parameters. Usage: $0 interval(in second) endtime(time to end the sending) peer_number(peer's telephone number) SMS_context(content of SMS)" fi
Linux脚本,#/bin/bash if [ $1 = cat ];then echo "dog"; elif [ $
shell脚本 /bin/bash if [[ $1=="D" ]]; then echo D else echo M
Linux红帽shell编程,在bin目录解析器用到sh和bash,显示脚本用到sh+ 文件名.那bash的咋看 .
/bin/bash for ((a=1;a
/bin/bash #test.sh for i in 1 2 3 4 5 6 7 8 9 10 echo -n "$i
linux下用./*.bin执行bin 报错 -bash: ./: is a directory
bash shell中if [-f $2]和echo -e是什么意思
Linux中sed命令的使用? dog cat dog pig dog linux dog unix
linux脚本中read line if [ -z "$data"
shell脚本if [ $1
Linux中echo
if [ -z $(echo $1 | sed -e 's/[0-9]//g') ]; then