shell command 的問題 - Linux

Ethan avatar
By Ethan
at 2010-11-15T13:20

Table of Contents

如果有一個command line

echo "Yes"|sh myCommand y

如果在shell script內可以用 read 去讀取前面的stdinput "Yes"

但是如果要讀取一些特殊自元的話 例如 echo "?"|sh myCommand y

或者 echo "Great!"|sh myCommand y

echo "?" 會出現的錯誤訊息是 test: unknown operator 5

echo "Great!" 則錯誤訊息會跑出我的script.. 例如
echo "Great"find ~/.xxx/"|myCommand y
>
然後就會出現問題

google 沒看到相關的問題 (或者我關鍵字下錯..)

不知道有沒有板友們知道這是什麼問題嗎

--
Tags: Linux

All Comments

Joseph avatar
By Joseph
at 2010-11-16T15:30
'!'
Ula avatar
By Ula
at 2010-11-21T12:42
但是如果一定要用我的格式呢!
Steve avatar
By Steve
at 2010-11-22T01:02
有用bash -x script 看過是哪一個指令出問題嗎?
Kelly avatar
By Kelly
at 2010-11-23T01:46
謝謝!!! 我不知道可以這樣測script

想砍init?

Damian avatar
By Damian
at 2010-11-15T02:54
直接借標題用,因為我有不小心幹掉init過 (‘-’)r 狀況: 我用andlt;Altandgt;andlt;SysRqandgt;k (SAK) 想把tty1上的東西清乾淨 就kernel panic -- not syncing .....了 1,為什麼init會attached再tty ...

想砍init?

Rachel avatar
By Rachel
at 2010-11-15T02:32
各位好: 在下無聊輸入以下內容 [rootatlocalhost ~]# kill -9 1 結果啥也沒發生,不會當機也...這麼神奇,有人知道為啥嗎?是哪個機制 保護了init這個主程式...atata - ...

顯卡用什麼驅動程式哪裡看?

Zenobia avatar
By Zenobia
at 2010-11-15T02:14
請問顯卡用什麼驅動程式要去哪裡看? 以前說是看 /etc/X11/xorg.conf 可是我的是這樣子: Section and#34;Deviceand#34; Identifier and#34;Configured Video Deviceand#34; EndSecti ...

[情報] Ubuntu 10.10 Release Party @ Taipei

Elizabeth avatar
By Elizabeth
at 2010-11-14T20:55
※ [本文轉錄自 jtmh 信箱] 作者: threesecond (0.3秒) 標題: Ubuntu 10.10 Release Party at Taipei 時間: Sat Nov 13 00:37:16 2010 請版主代轉(或授權)公告,謝謝。 在 11/20 (六) 我們要在台北辦 Par ...

KDE4的問題

Susan avatar
By Susan
at 2010-11-14T20:14
Mandriva2010.1 KDE4.4最近常發生一些奇怪的事情,桌面閒置太久後,視窗、畫面、和 工具列的彈出速度都會變得很慢,LAG到快當機。 還有SMPlayer好像有一種播放AVI會當機的BUG,所有畫面會全部凍結 必須要重新開機才行 = = -- :「我叔叔以前有兼差做消波塊 and ...