linux - Use output of a command to feed another one -
i have command outputs list of ip addresses; example:
bash test3.sh
output is:
10.4.128.2 10.4.128.3 10.4.128.4 10.4.128.5
i want run command using these outputs arguments, this:
fio --client 10.4.128.2 jobfile1 --client 10.4.128.3 jobfile1 --client 10.4.128.4 jobfile1 --client 10.4.128.5 jobfile1
how can this?
you can use printf
:
out=$(bash test3.sh) printf "fio"; printf " --client %s jobfile1" $out; echo fio --client 10.4.128.2 jobfile1 --client 10.4.128.3 jobfile1 --client 10.4.128.4 jobfile1 --client 10.4.128.5 jobfile1
Comments
Post a Comment