- 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
推薦閱讀
- Raspberry Pi for Python Programmers Cookbook(Second Edition)
- Learn Programming in Python with Cody Jackson
- 零基礎學Python數據分析(升級版)
- Serverless架構
- Learning Zurb Foundation
- 批調度與網絡問題的組合算法
- Mastering React
- Spring Boot+MVC實戰指南
- Learning Docker Networking
- 區塊鏈國產化實踐指南:基于Fabric 2.0
- Learning Splunk Web Framework
- 貫通Tomcat開發
- 計算機應用基礎(第二版)
- Web前端開發最佳實踐
- Mastering PowerCLI