I have an application (myapp) that gives me a multiline output
result:
abc|myparam1|def
ghi|myparam2|jkl
mno|myparam3|pqr
stu|myparam4|vwx
With grep and sed I can get my parameters as below
myapp | grep '|' | sed -e 's/^[^|]*//' | sed -e 's/|.*//'
But then want these myparamx values as paramaters of a script to be executed for each parameter.
myscript.sh myparam1
myscript.sh myparam2
etc.
Any help greatly appreciated
sed -e 's/^[^|]*//' | sed -e 's/|.*//'could be written assed -e 's/^[^|]*//' -e 's/|.*//'or evensed -e 's/^[^|]*//; s/|.*//'