wademi
asked on
In C shell How do I get the folder name using a foreach loop
In C shell How do I get the folder name using a foreach loop
ASKER
This is what I had before:
#! /bin/csh -f
set SourceDir = /home/milligram/mnt
set DestDir_IOS = Myvideos/IOS
foreach directory ($SourceDir)
echo $SourceDir
end
can you corect it for me. Thanks a million!!!!!!!!!
#! /bin/csh -f
set SourceDir = /home/milligram/mnt
set DestDir_IOS = Myvideos/IOS
foreach directory ($SourceDir)
echo $SourceDir
end
can you corect it for me. Thanks a million!!!!!!!!!
ASKER
Can you explain
what is the 'ls' for?
what does the "test" do? is it a cshell syntax?
Can variables be placed in quotes.."$directory"
foreach directory (`ls`)
test -d "$directory" && echo "This is a directory: $directory"
end
what is the 'ls' for?
what does the "test" do? is it a cshell syntax?
Can variables be placed in quotes.."$directory"
foreach directory (`ls`)
test -d "$directory" && echo "This is a directory: $directory"
end
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
test -d "$directory" && echo "This is a directory: $directory"
end