看板 Linux 關於我們 聯絡資訊
請教各位, 利用 shell 從檔案 file 將字串 "asdf" 所屬的那行輸出至 file2 的語法為 sed -n "/asdf/w file2" file 如果現在我要將字串 "asdf" 或 "ffff" 所屬的那行輸出至 file2 的語法應該如何修改 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.252.192.165
dreamroyc:用xargs 試試看 08/26 22:42
mshx:能用grep去做嗎? 08/26 23:02
kiani:sed -n "/["asdf""ffff"]/w file2" file ?? 08/26 23:06
PanJC:謝謝各位, 我最後是用 grep 做 08/27 00:23
specialize:sed -nre'/(asdf|ffff)/w file2' file 08/28 11:12