in Education by
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 JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Please see xargs. For example: myapp | grep '|' | sed -e 's/^[^|]*//' | sed -e 's/|.*//' | xargs -n 1 myscript.sh

Related questions

0 votes
    This smells buggy, but probably, someone can explain it: The following script doesn't work, the output is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I've created a python3 script that runs fine on command line but when I try to run as a daemon ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    Which of the following parameter defines line type such as dashed and dotted? (a) lty (b) pch (c) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 29, 2021 in Education by JackTerrance
0 votes
    In shell script, How can I set 0 as default value to parameter. param2=0 ${2:-0} and ${2 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    In shell script, How can I set 0 as default value to parameter. param2=0 ${2:-0} and ${2 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    In shell script, How can I set 0 as default value to parameter. param2=0 ${2:-0} and ${2 ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    The line integral of which parameter is zero for static fields? (a) E (b) H (c) D ... theory proposed by,electromagnetic theory engineering physics,electromagnetic theory nptel...
asked Nov 6, 2021 in Education by JackTerrance
0 votes
    I have file called q.r and it has chmod of 755, how can I run it using a command-line? sayHello...
asked Jan 24, 2022 in Education by JackTerrance
0 votes
    I want to supply some command-line parameters from a R script I have. And it runs on windows. I just want it ... help me with it? Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    Predict the output of the following JavaScript code.
    Why we use script mode for python programming while we have the interactive mode. Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
...