Hello List,
I am new to shell scripting and programming in general, so please excuse my
ignorance. :)
I am trying to setup a menu for some videos that I have so that you can
select one and it will play it using xine or mplayer. My first attempt was
to assign each video a variable name and then I
It's not necessary to print the array, select will do that for you.
The way you're using select makes it only have access to one value
which is the last one in the array because the "for index" loop leaves
index pointing to the last array element. Also, don't use ls like this
- it's eyes-only.
Tr
Marc Herbert-5 wrote:
>
> DennisW a écrit :
>> Also, don't use ls like this - it's eyes-only.
>
> Here is a demonstration:
>
> touch "filename with spaces"
> ARRAY=( $(ls) ) # BUG
> for f in "${arr...@]}"; do echo "file: $f"; done
> ARRAY=( * ) # OK
> for f in "${arr...@]}"; do echo "f