Quote:
|
Originally Posted by vgersh99
Code:
echo '$ABC_SH/mycode.sh -v aaa -r /mydir/files/data/ ${MYDIR}/hello.sh $DIR/bin' | sed -e 's/.* \([^ ][^ ]*MYDIR[^ ][^ ]*\).*/\1/g'
|
How can I modify the above to extract if multiple ${MYDIR}/hello.sh exist in the same line
$ABC_SH/mycode.sh -v aaa -r /mydir/files/data/ ${MYDIR}/hello.sh $DIR/bin ${MYDIR}/hi.sh
For eg. (if my pattern is MYDIR )
above should return
${MYDIR}/hello.sh
${MYDIR}/hi.sh