A Bourne shell gotcha: redirection order
I was reminded of this by seeing it in a shell script recently: theorder that you do redirection in on a command line can be important.This means that the following two lines are not equivalent:
foobar 2>&1 >/some/wherefoobar >/some/where 2>&1
The first one sends standard error to wherever the current standardoutput is, and then sends standard output to /some/where ; the lattersends both standard output and standard error to /some/where .
新增留言板
令我對這地方了解更多
我會盡量按大家需要的方向寫文章的
為方便交流互動
今日開始加設了留言板
之前討論過的話題可以在此繼續
如果有朋友仲想參加調查
唔好比佢停呀
A Bourne shell irritation
I was bitten by this today, so I am going to grump about it.Today's irritation with the Bourne shell is that the followingis illegal syntax:
echo hi &;
This probably looks peculiar and silly, so let me give a real examplethat is also illegal:
for i in *watch; do nohup ./$i >/dev/null 2>&1So is '
; ;', and for the same reason: in the Bourne
龍虎門
法蘭克福
但在法蘭克福,
那種寂寞卻很寫意。
第一天,
已經疲憊得說不出話,
卻要匆匆忙忙在Mainz四處跑去買東西,
很累人很想哭。
第二天起床後泡在甘菊浴鹽中良久,
心情慢慢好了。
星期天所有店舖都休息,
隨便買
Slashdot's tacit admission of failure
Slashdot has recently started running what it calls 'Backslash'stories, which have (as it puts it):
[...] some of the most interesting comments and exchanges on a handfulof yesterday's Slashdot posts [...]
To me, the most interesting thing about these stories is that they area tacit admission that Slashdot's comment management model is brokenand that a lot of people don't read the comments on Slashdot stories.If most people did regularly read Slashdot comments,
重開記事
於是我收到了電郵,於是在 msn 上被迫問。我都以兩個表情符號來回答: 扶牆和趴桌子。(貼不上來)
最易打發的還是謝某,兩日間打來三次,問:「你做乜 close 個 blog ?」「你都唔睇,關你乜事。」「我雖然唔睇,……」 blah blah blah ,然
我就在這裡
《女王的教室》的平凡
或許我們不需要對《女王的教室》太認真。它畢竟是一套電視劇。它在每集的開場白時,就將內容定位為「一群小學生對抗
詩(給教我使用msn表情符號的人)
醒來
我們躲在符號背後說話
讓它們誇張的表情給我們溫熱
它們多餘怪異代替我們出軌,讓它們
說話,我們就安心
到頭來誰也沒有沉默
我想說的話流淌在失眠的褥上
片語的塵蟎深入鼻子
組織句段河流曲折碎金
河底砂石溢出全部的未