bash變數內容tab變成空白以致無法使用cut -f - Linux

By Ula
at 2010-01-10T15:23
at 2010-01-10T15:23
Table of Contents
標題好像有點長...
我只是想要描述完整一點...XD
我想要處理這樣的資料:
1 4 5
^^^^^^^
tab
也就是第一欄是1 第二欄是4 5
但是
$ cat -|while read i ;do echo $i|cut -f 2;done;
輸入:1 4 5
結果是:1 4 5
$ cat -|while read i ;do echo $i;done;
input: 1 4 5
result: 1 4 5
我覺得像是tab在某個步驟被換成空白了
請問是在哪個步驟呢@@?
1.cat
2.pipe |
3.read時
4.i 設值時
5.echo時
我自己猜是設值時....
因為
i=`echo -e "1\t4 5"`;echo $i
結果是 1 4 5
請問是不是我有什麼觀念不正確
我應該怎麼避免這樣的情形
達到我的目的呢?
謝謝!
如果有op也請告知...不好意思QQ
--
Tags:
Linux
All Comments

By Erin
at 2010-01-13T23:36
at 2010-01-13T23:36

By Rae
at 2010-01-17T19:28
at 2010-01-17T19:28
Related Posts
如何讓第一個分割區是ReiserFS又能安裝XP

By Sierra Rose
at 2010-01-09T21:50
at 2010-01-09T21:50
top指令登入人數異常!?

By Bethany
at 2010-01-09T16:43
at 2010-01-09T16:43
國網中心的 MDV mirror 停止更新了?

By Adele
at 2010-01-09T10:35
at 2010-01-09T10:35
國網中心的 MDV mirror 停止更新了?

By Frederic
at 2010-01-09T09:49
at 2010-01-09T09:49
如何從程式的指令找到它的位置?

By Donna
at 2010-01-08T22:37
at 2010-01-08T22:37