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

  • 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
主站蜘蛛池模板: 信丰县| 新竹县| 九龙坡区| 凤庆县| 黄石市| 辽阳县| 水富县| 利川市| 闽侯县| 华宁县| 绥滨县| 古蔺县| 曲周县| 工布江达县| 永康市| 香河县| 东至县| 京山县| 聂拉木县| 葫芦岛市| 凌源市| 河曲县| 岳西县| 从化市| 六盘水市| 黎平县| 永宁县| 平顺县| 新晃| 无极县| 杭州市| 铜山县| 阿克陶县| 休宁县| 华亭县| 苗栗县| 东安县| 菏泽市| 南阳市| 逊克县| 太谷县|