Thread: bash script piping multiple results?
hi guys
writing bash script hope can used "get_iplayer" automate specific shows download iplayer platform.
used use gui's this, have ended breaking and/or didnt offer appropriate support.
downloaded core get_iplayer application/scripts.
manually download shows interested in search string like:
this returns likecode:get_iplayer-2.79/get_iplayer zane\ lowe | grep zane\ lowe | awk '{print $1}'
i need strip of trailing ":" each line, pass these values variable following string:13140:
13141:
13142:
13143:
so questions:code:get_iplayer 13151 --modes radio --modes iphone,flashaac --get --output ~/downloads/iplayer\ downloads/zane\ lowe/
1. can pipe 2nd code exert above end of 1st code exert? each of 4 results, execute last command?
2. failing above, can put 1st code exert "for in 'code'", automatically go through loop of 4 results?
3. guess last option use variables or temp files output results of 1st code exert. , use source of loop structure 2nd code exert?
hoping haven't overcomplicated think should simple issue...
many thanks!
there better ways of doing get_iplayer itself, use you've posted
for in $(blah blah blah) puts output of commands in ()s variable $icode:for in $(get_iplayer --type=radio zane\ lowe | grep zane\ lowe | awk '{print $1}'); get_iplayer --g "${i%:}" --modes radio --modes iphone,flashaac; done
"${i%:}" in second line result of first line trailing : removed
for blah blag blah; do
blah blah
done
takes each result of blah blag blah , passes blah blah 1 @ time.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] bash script piping multiple results?
Ubuntu
Comments
Post a Comment