$'\nnn' - Linux

Table of Contents

※ 引述《antontw (習慣)》之銘言:
: cat test.txt #範例文字檔
: \346\226\260\351\200\262
: anton@gama:~/test$ cat test.sh
: #!/usr/bin/env bash
: T=`cat test.txt`
: echo "echo "\$\'$T\'|bash
: 這樣就可以把 test.txt 裡面的 \346\226\260\351\200\262 轉回來。
: 沒有很好啦,應該會有很多例外...

一行文:

eval echo "$'$(< test.txt)'"

--
How shall my heart be unsealed unless it is broken?
By Kahlil Gibran

--

All Comments

Elvira avatarElvira2008-09-08
滿分( ̄︶ ̄)↗