向脚本传递参数和位置变量

[root@localhost ~]# cat posVar.sh
#!/bin/bash

echo "this is the bash:$0"
echo "this is the first:$1"
echo "this is the seconde:$2"
[root@localhost ~]# bash posVar.sh wei hongrao
this is the bash:posVar.sh
this is the first:wei
this is the seconde:hongrao

你可能感兴趣的:(linux)