請教一個sed的寫法 - Linux
By Agatha
at 2011-03-19T16:51
at 2011-03-19T16:51
Table of Contents
各位版友好
小弟目前有一個文字檔(test.dat)
想要把"字串"給抓出來
利用sed -n '/\".*\"/p' test.dat
其中的RE是".*",其中用\讓"變成普通的字元
只是抓出來的是含有該pattern的行
但是我只想要印出該字串~不想要印出整行出來
請問我要怎麼寫才是正確的?
不知道有沒有辦法把不符合這個pattern的token用空字串取代掉@@?
謝謝各位版友的指教
--
~宅男的四個徵兆~
∠□ ○ ! * \○/ ★ (○ ?
╦╦└□ " ○□═ □ □>
║║√√ ╦══╦ ∥ |\
一回家就上PTT 每天想正妹 以當好人為樂 忘記正妹虧欠自己
--
小弟目前有一個文字檔(test.dat)
想要把"字串"給抓出來
利用sed -n '/\".*\"/p' test.dat
其中的RE是".*",其中用\讓"變成普通的字元
只是抓出來的是含有該pattern的行
但是我只想要印出該字串~不想要印出整行出來
請問我要怎麼寫才是正確的?
不知道有沒有辦法把不符合這個pattern的token用空字串取代掉@@?
謝謝各位版友的指教
--
~宅男的四個徵兆~
∠□ ○ ! * \○/ ★ (○ ?
╦╦└□ " ○□═ □ □>
║║√√ ╦══╦ ∥ |\
一回家就上PTT 每天想正妹 以當好人為樂 忘記正妹虧欠自己
--
Tags:
Linux
All Comments
By Ophelia
at 2011-03-23T11:33
at 2011-03-23T11:33
By Connor
at 2011-03-28T02:22
at 2011-03-28T02:22
By Carolina Franco
at 2011-03-28T15:22
at 2011-03-28T15:22
By Candice
at 2011-04-02T06:06
at 2011-04-02T06:06
By Dinah
at 2011-04-02T17:49
at 2011-04-02T17:49
By John
at 2011-04-05T14:41
at 2011-04-05T14:41
By Christine
at 2011-04-07T04:19
at 2011-04-07T04:19
By Quanna
at 2011-04-09T19:37
at 2011-04-09T19:37
By Frederic
at 2011-04-10T12:56
at 2011-04-10T12:56
Related Posts
how to install ibus-chewing on Ubuntu 10.04
By Rosalind
at 2011-03-19T13:52
at 2011-03-19T13:52
視訊鏡頭在cheese有畫面,卻在skype,gtalke沒畫面
By Kumar
at 2011-03-19T13:27
at 2011-03-19T13:27
Linux新核心2.6.38大幅提昇效率
By Bethany
at 2011-03-19T08:15
at 2011-03-19T08:15
ubuntu10.10安裝kscope 重開機errror
By Necoo
at 2011-03-18T22:35
at 2011-03-18T22:35
無法進入RHEL6的GUI畫面...謝謝各位大大
By Noah
at 2011-03-18T18:08
at 2011-03-18T18:08