- 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
推薦閱讀
- 從零開始構建企業級RAG系統
- Python編程自學手冊
- Developing Mobile Web ArcGIS Applications
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- PyTorch自然語言處理入門與實戰
- Securing WebLogic Server 12c
- Linux命令行與shell腳本編程大全(第4版)
- 機器學習與R語言實戰
- Kubernetes源碼剖析
- C++ Fundamentals
- 大學計算機基礎
- Visual Basic程序設計全程指南
- Practical Responsive Typography
- Unreal Engine Game Development Cookbook
- VC++ 2008專題應用程序開發實例精講