Results 1 to 3 of 3
Hi,
I have some directory names such as : Bruce Springsteen & the E Street Band.
There are spaces between each word.
Directory Music contains :
Bruce Springsteen & the ...
- 01-05-2008 #1Just Joined!
- Join Date
- Oct 2006
- Posts
- 29
How to put in a tcsh variable a list of directories containing spaces
Hi,
I have some directory names such as : Bruce Springsteen & the E Street Band.
There are spaces between each word.
Directory Music contains :
Bruce Springsteen & the E Street Band
The Rolling Stones
I would like to put my directory names in a shell variable :
set listOfDirs = `ls Music`
foreach data ($listOfDirs)
echo $data
end
As there are spaces (and moreover the & character), it does not work. I get :
Bruce
Springsteen
&
the
...
How can I get the complete directory name, eventhough it contains spaces and special characters.
Thanks.
Eric.
PS : I could rename the directories, but how can I do it by script (
).
- 01-06-2008 #2Code:
set listOfDirs = (Music/*/) @ idx = 1 while ($idx <= $#listOfDirs) echo "$listOfDirs[$idx]" @ idx ++ end
- 01-06-2008 #3Just Joined!
- Join Date
- Oct 2006
- Posts
- 29
Hi,
This helped me a lot. Thanks for your help.
Eric.


Reply With Quote