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
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
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 "file: $f"; done
Jon_R schrieb:
> http://old.nabble.com/file/p27316649/newsh2.sh newsh2.sh
You have a misunderstanding about select here, I guess.
Select is supposed to display a list of given words and take user input
(index to these words). It more or less is the same as a for loop, it
just doesn't iterate th
On Jan 25, 7:28 pm, Jon_R wrote:
> 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
>