[Wolves] CLI - how to pass a series of numbers to command

Mark Croft mark.croft.lug at gmail.com
Tue Aug 19 06:04:05 UTC 2014


thank you , so easy to find when using the right term too search for examples


On 11 August 2014 11:42, Adam Sweet <adam at adamsweet.org> wrote:
> On 10/08/2014 18:01, Mark Croft wrote:
>> hope this all makes some sense.
>>
>> i find most of the time when i am doing get_iplayer stuff i want to do
>> a whole series - con programme numbers/codes
>>
>> eg
>>
>>  get_iplayer --get 342 343 344 345 --subtitles 342 343 344 345
>>
>> is there a better way to do this? some trick? to pass each number
>> starting from 342 and ending at 345 , i am sure i have seen it
>> somewhere but tried to google  for it.
>
> You use curly brackets to express the number range, ie {342..345}
>
> Some links here:
>
> http://stackoverflow.com/questions/169511/how-do-i-iterate-over-a-range-of-numbers-defined-by-variables-in-bash
>
> http://wiki.bash-hackers.org/syntax/expansion/brace
>
> http://www.cyberciti.biz/faq/bash-for-loop/
>
> http://www.cyberciti.biz/faq/unix-linux-iterate-over-a-variable-range-of-numbers-in-bash/
>
> As your numbers in the example don't go over a ten boundary, you could
> also do 34{2..5}. Examples:
>
> adam at bunsen:~$ echo {342..345}
> 342 343 344 345
> adam at bunsen:~$ echo 34{2..5}
> 342 343 344 345
>
> Regards,
>
> Adam Sweet
>
> --
>
> http://blog.adamsweet.org/
>
> _______________________________________________
> Wolves LUG mailing list
> Homepage: http://www.wolveslug.org.uk/
> Mailing list: Wolves at mailman.lug.org.uk
> Mailing list home: https://mailman.lug.org.uk/mailman/listinfo/wolves



More information about the Wolves mailing list