Skip to main content

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:

code:
get_iplayer-2.79/get_iplayer zane\ lowe | grep zane\ lowe | awk '{print $1}'
this returns like
13140:
13141:
13142:
13143:
i need strip of trailing ":" each line, pass these values variable following string:

code:
get_iplayer 13151 --modes radio --modes iphone,flashaac --get --output  ~/downloads/iplayer\ downloads/zane\ lowe/
so questions:
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

code:
for in $(get_iplayer --type=radio zane\ lowe | grep zane\ lowe | awk '{print $1}');  get_iplayer --g "${i%:}" --modes radio --modes iphone,flashaac;  done
for in $(blah blah blah) puts output of commands in ()s variable $i

"${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

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support