sed delete

view full story

http://www.unix.com – I am not able to analyze the below code.. What I expected is that DELETED will be replaced with the first field in every line.But after giving a try, the output was different. Can anyone pleas analyze and explain the code in detail? Many thanks... Code: $ sed 's/[a-zA-Z]* /DELETED /g' g1.txt > g4.txt $ $ more g1.txt giri sripathi sohan meka  madhave durga ram baba siva venkat satish srikar $ $ more g4.txt DELETED sripathi DELETED DELETED  DELETED durga ram baba siva DELETED DELETED srikar Moderator's Comments: (HowTos)