This question came from our site for system and network administrators.

2

Why are you resistant to learning what is likely the best tool to accomplish this?
–
EEAAMar 2 '13 at 16:16

i prefer to learn sed and awk separately so that i don't get confused
–
WerulzMar 2 '13 at 16:59

Part of learning how to use those two tools is recognizing the best one for the job; it's not like learning a programming language, and it makes things much harder on yourself if you try to use the wrong one. It's also worth noting that cut is a specialized tool with few options to learn, as opposed to awk and sed which have their own associated sub-languages.
–
Andrew BMar 2 '13 at 19:26

If it can't be done in sed or grep you guys should just say so. And then present a case for awk.
–
Stefan LasiewskiMar 4 '13 at 5:47

dude sorry for not saying this in thread but there might be other text in the file that i will edit via bash ....just give me a sed command that will extract the value between the first " " in file
–
WerulzMar 2 '13 at 17:14

grep has an option for only returning the matched string. echo $output | grep -o '"[^"]*"' would achieve what you do above with sed.
–
LadadadadaMar 2 '13 at 18:31