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

  • Bash Cookbook
  • Ron Brash Ganesh Naik
  • 105字
  • 2021-07-23 19:17:40

Getting ready

Let's get ready for the exercise by creating some data sets which mimic common daily problems:

$ cd ~/
$ echo
$ echo -e "XML_HDR='<?xml version="1.0" encoding="UTF-8"?>'\\nSRT_CONTR='<words type="greeting">'\\nEND_CONTR='</words>'" > xml-parent.tpl
$ echo -e "ELM='\"<word lang=\"\$1\">\"\$2\"</word>\"'" > word.tpl
$ echo -e "\"EN\",\"Hello\"\n\"FR\",\"Bonjour\"" > words.csv
In Bash, the single quote ( ') is used for literal strings. In this case, we want every part of the string to be present without escaping slashes and double quotes.

To operate this script, you have the following applications installed for use within the script:

$ sudo apt-get install npm sed awk
$ sudo npm install -g xml2json-command
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
主站蜘蛛池模板: 安义县| 清丰县| 宣武区| 剑川县| 嘉祥县| 靖边县| 乌拉特后旗| 大埔县| 宜兰县| 抚顺市| 抚州市| 井研县| 开江县| 万山特区| 甘孜县| 津南区| 淳化县| 扶余县| 榆树市| 肃宁县| 灵石县| 唐山市| 油尖旺区| 固安县| 雷山县| 庆城县| 闻喜县| 白水县| 新化县| 延寿县| 六枝特区| 渭南市| 榆社县| 乡城县| 手游| 罗平县| 从化市| 万全县| 西吉县| 利津县| 康乐县|