- 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
推薦閱讀
- Java入門經(jīng)典(第6版)
- Objective-C應用開發(fā)全程實錄
- Docker進階與實戰(zhàn)
- PHP基礎案例教程
- Spring實戰(zhàn)(第5版)
- Easy Web Development with WaveMaker
- JavaScript by Example
- Mastering Predictive Analytics with Python
- MongoDB權威指南(第3版)
- 快人一步:系統(tǒng)性能提高之道
- HTML5 APP開發(fā)從入門到精通(微課精編版)
- Visual Basic程序設計上機實驗教程
- Visualforce Developer’s guide
- JSP程序設計實例教程(第2版)
- Android系統(tǒng)下Java編程詳解