bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selecting out of an array


From: Jon_R
Subject: Re: Selecting out of an array
Date: Wed, 27 Jan 2010 18:26:58 -0800 (PST)



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 "${ARRAY[@]}"; do echo "file: $f"; done
> ARRAY=( * )      # OK
> for f in "${ARRAY[@]}"; do echo "file: $f"; done
> 
> 

This is gold Marc! This answers and solves another issue I was having, as
I'm sure you can surmise. :)

Jon
-- 
View this message in context: 
http://old.nabble.com/Selecting-out-of-an-array-tp27316649p27350192.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]