官术网_书友最值得收藏!

Getting program input parameters 

Retrieving program input parameters or arguments is very similar to function parameters at the most basic level. They can be accessed in the same fashion as $1 (arg1), $2 (arg2), $3 (arg3), and so on. However, so far, we have seen a concept called flags, which allows you to perform neat things such as-l, --long-version, -v 10, --verbosity=10. Flags are effectively a user-friendly way to pass parameters or arguments to a program at runtime. For example:

bash myProgram.sh -v 99 --name=Ron -l Brash

Now that you know what flags are and how they can be helpful to improve your script, use the following section as a template.

主站蜘蛛池模板: 孝义市| 普兰店市| 洱源县| 南充市| 顺义区| 黑山县| 华蓥市| 大安市| 辉县市| 通海县| 浮山县| 萨迦县| 凤冈县| 武汉市| 新巴尔虎右旗| 南部县| 孝义市| 牡丹江市| 新乐市| 赣州市| 裕民县| 洪泽县| 化德县| 江西省| 永川市| 年辖:市辖区| 静海县| 福泉市| 巴中市| 漯河市| 西乌| 凉城县| 历史| 南京市| 黎平县| 西丰县| 乡城县| 农安县| 安多县| 桦甸市| 双辽市|