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

  • 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
主站蜘蛛池模板: 固安县| 山东省| 定远县| 色达县| 天峻县| 九寨沟县| 且末县| 石渠县| 财经| 新丰县| 汝阳县| 石林| 兴安盟| 乌苏市| 新龙县| 南和县| 衡南县| 鄱阳县| 澄迈县| 兴城市| 阜城县| 新田县| 宁安市| 徐闻县| 宁强县| 霸州市| 湘阴县| 喀喇沁旗| 唐河县| 鹰潭市| 阜宁县| 绍兴市| 将乐县| 武平县| 长垣县| 汝阳县| 宜章县| 秭归县| 白城市| 堆龙德庆县| 黑河市|