Imagine I have a file like this:

buf="$(cat <<EOF
part1: a part
part5: another part
# comment
part9: 9th part
EOF
)"

How can I get the line containing 'part5' using ksh93 string
operators, avoiding both 'while read...' and 'sed'? I tried
${buf##pattern}, ${buf#pattern}, ${buf%pattern}, ${buf%%pattern} but
they all _remove_ the string pattern. I need a string operator which
only leaves the string matching pattern and removes the rest.

Cheers,
William
-- 
    @,,@   William James
   (\--/)  [EMAIL PROTECTED]
  (.>__<.) GNU/Solaris hacker
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to