Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- RFID
- django
- programming_book
- Book review
- Linux
- hbase
- history
- erlang
- Italy
- Kuala Lumpur
- QT
- essay
- comic agile
- program
- hadoop
- agile
- Java
- ubuntu
- leadership
- Python
- Programming
- France
- MySQL
- Book
- Software Engineering
- web
- Malaysia
- Spain
- management
- psychology
Archives
- Today
- Total
treat escape sequence using sed in bash script 본문
case
1. dump monetdb database into file (escape sequences show like '\t', '\n' properly)
2. split it into table by table using bash script (escape sequences show like 't', 'n')
3. bulk input table dump file into other database
1. dump monetdb database into file (escape sequences show like '\t', '\n' properly)
2. split it into table by table using bash script (escape sequences show like 't', 'n')
3. bulk input table dump file into other database
problem: cannot write escape sequence properly (want: '\t', '\n' / real: 't', 'n')
solution: use eight back slashes
solution: use eight back slashes
... _line=`echo $_line | sed 's/'\''\([t|n]\)'\''/'\''\\\\\\\\\1'\''/g'` echo "${_line}" >> $_file ...
Comments