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

Quoting

The way you can reliably include characters that are special to Bash literally in a command line is to quote them. Quoting special characters makes Bash ignore any special meaning they may otherwise have to the shell, and instead use them as plain characters, like a-z or 0-9. This works for almost any special character.

We say "almost", because there's one exception: there's no way to escape the null character (ASCII NUL, 0x00) in a shell word.

Quoting is the most important thing that even experienced people who write shell script sometimes get wrong. Even a lot of very popular documentation online fails to quote correctly in example scripts! If you learn to quote correctly, you will save yourself a lot of trouble down the line. The way quoting in shell script works very often surprises people coming from other programming languages.

We will look at three kinds of quoting: escaping, single-quoting, and double-quoting.

主站蜘蛛池模板: 兰州市| 盐池县| 浦县| 营山县| 丰台区| 稷山县| 临邑县| 鸡泽县| 临高县| 清流县| 买车| 托克托县| 新田县| 岳普湖县| 梁山县| 长宁区| 应用必备| 铜梁县| 定西市| 交城县| 福清市| 科技| 龙海市| 麦盖提县| 综艺| 丰原市| 顺平县| 嫩江县| 永宁县| 平果县| 丽江市| 类乌齐县| 读书| 永嘉县| 信阳市| 通城县| 精河县| 河池市| 巫溪县| 大石桥市| 温宿县|