The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-04-2008
metalwarrior metalwarrior is offline
Registered User
 

Join Date: Feb 2008
Posts: 16
sed (assigning two or more patterns) ?

hi, how does regular expression for "or" and "and" work in sed?
like if I want sed to find and do something only with the lines that contain "abc" or "123" pattern. or lines that have "abc" and "123" both.
I normally use this regular expression for that: ."*{abc,123}.*" but itdoesnt work in sed.
can anyone fix this line for me?
sed '.*{abc,123}.*/s# etc...' filename
Reply With Quote