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

Resetting positional parameters

In certain situations, we may need to reset original positional parameters.

Let's try the following:

$ set Alan John Dennis

This will reset the positional parameters.

Now $1 is Alan, $2 is John, and $3 is Dennis.

Inside scripts, we can save positional parameters in a variable, as follows:

oldargs=$*

Then, we can set new positional parameters.

In addition, we can bring back our original positional parameters, as follows:

set $oldargs
主站蜘蛛池模板: 郴州市| 儋州市| 元江| 锡林郭勒盟| 石渠县| 浦北县| 张家界市| 新丰县| 西乌珠穆沁旗| 伊金霍洛旗| 横峰县| 兰州市| 偃师市| 兴安盟| 万州区| 民权县| 关岭| 宁阳县| 疏附县| 西城区| 上犹县| 嘉峪关市| 福清市| 布拖县| 泗阳县| 高要市| 凤山县| 安塞县| 彩票| 包头市| 手游| 呼图壁县| 高尔夫| 德昌县| 漠河县| 镶黄旗| 沿河| 威远县| 团风县| 南充市| 浦江县|