- 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
推薦閱讀
- Visual C++程序設計學習筆記
- 無代碼編程:用云表搭建企業數字化管理平臺
- 網店設計看這本就夠了
- Nexus規模化Scrum框架
- Visual C++應用開發
- iOS編程基礎:Swift、Xcode和Cocoa入門指南
- HTML5入門經典
- Python深度學習:基于TensorFlow
- Windows Phone 7.5:Building Location-aware Applications
- Mastering openFrameworks:Creative Coding Demystified
- D3.js By Example
- Modern C++ Programming Cookbook
- H5+移動營銷設計寶典
- Responsive Web Design with jQuery
- C++程序設計習題與實驗指導