View Full Version : How can we write a C shell script to make Dirs
Unregistered
04-25-2002, 03:25 AM
How can we write a C shell script to make Dirs, and subdirs, and help file in each subdirs?
someone said have to use FOREACH loop, but I don't really understand the function and instruction of Foreach.
any example will be helpful.
rohit
04-25-2002, 04:48 AM
this was one of the oldest DOS Attack
for ever
mkdir something
cd something
actually a directory takes some place 512 bytes i think so after few hrs u r screwed
Deckard
04-25-2002, 05:20 AM
foreach var (wordlist)
# Commands
end
The variable var is successively set to each member of wordlist. Members of the wordlist are space seperated.
Example:
#!/bin/csh
foreach color (red orange yellow green blue)
echo $color
end
The wordlist may also include wildcards:
#!/bin/csh
foreach file (*)
cat file
end
HTH,
Unregistered
04-27-2002, 10:27 PM
thank you
that's some help
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.