Shell,Bash脚本默认参数
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Shell,Bash脚本默认参数相关的知识,希望对你有一定的参考价值。
#!/bin/bash echo "--------------------------------------" echo "Script name ................... [ $0 ]" echo "First parameter ............... [ $1 ]" echo "Second parameter .............. [ $2 ]" echo "Process ID .................... [ $$ ]" echo "Parameter count ............... [ $# ]" echo "All parameters ................ [ [email protected] ]" echo "FLAGS ......................... [ $- ]" echo "--------------------------------------" # EXAMPLE OUTPUT: # > ./shell-play-2.sh param1 param2 # -------------------------------------- # Script name ................... [ ./shell-play-2.sh ] # First Parameter ............... [ param1 ] # Second Parameter .............. [ param2 ] # Process ID .................... [ 555 ] # Parameter Count ............... [ 2 ] # All Parameters ................ [ param1 param2 ] # FLAGS ......................... [ hB ] # --------------------------------------
以上是关于Shell,Bash脚本默认参数的主要内容,如果未能解决你的问题,请参考以下文章