English 中文(简体)
• 如何用 s子把 output子生产三倍?
原标题:how to trim wipe output with sed?
  • 时间:2011-01-12 15:06:16
  •  标签:
  • sed

i want to trim an output of wipe command with sed. i try to use this one:

wipe -vx7 /dev/sdb 2>&1 | sed -u  s/.* ([0-9]+).*/1/g 

但出于某种原因,它没有工作。

当使用回合和amp时,它就能够印刷血压控制的产出!

echo "/dev/sdb: 10%" | sed -u  s/.* ([0-9]+).*/1/g 

什么是错的?

感谢!

问题回答




相关问题
how to tell sed "dot match new line"

I can t figure how to tell sed dot match new line: echo -e "one two three" | sed s/one.*two/one/m I expect to get: one three instead I get original: one two three

sed: using search pattern in output

I d like to use the search pattern in the output part of a sed command. For instance, given the following sed command: sed /HOSTNAME=/cHOSTNAME=fred /etc/sysconfig/network I d like to replace the ...

Text manipulation and removal

I have text files generated by one of my tools with structure shown below. 1 line text (space) multiple lines text (space) multiple lines text nr 2 ----------------------------------------------------...

Parse players currently in lobby

I m attempting to write a bash script to parse out the following log file and give me a list of CURRENT players in the room (so ignoring players that left, but including players that may have rejoined)...

how to use sed, awk, or gawk to print only what is matched?

I see lots of examples and man pages on how to do things like search-and-replace using sed, awk, or gawk. But in my case, I have a regular expression that I want to run against a text file to extract ...

Bulk Insert Code Before </body> Tag in 100 Files

I d like to insert <?php include_once( google_analytics.php ); ?> before the closing body tag of about 100 php files. Unfortunately the person who made the site didn t make a header or ...

Extract float from text line with sed?

I am issuing a sed replace on a line, trying to extract a particular floating-point value, but all that appears to be matched is the right-side of the decimal Text Line: 63.544: [GC 63.544: [DefNew: ...

热门标签