I realize this is a C programing forum, but there seems to be a lack of people who still use the c shell. So hopefully someone here does.
i have the following bourne script that lists all files adn directories in a given file. I have been asked to port it to the c shell and add functionality so that it will ask you to input names of directories and will then return a list of all their files and subdirectories.
My script:
#!/bin/sh
for i in *
do
if [ -d $i ]
then echo "$i is a sub directory"
else
echo "$i is a file "
fi
done
thanks zion
i have the following bourne script that lists all files adn directories in a given file. I have been asked to port it to the c shell and add functionality so that it will ask you to input names of directories and will then return a list of all their files and subdirectories.
My script:
#!/bin/sh
for i in *
do
if [ -d $i ]
then echo "$i is a sub directory"
else
echo "$i is a file "
fi
done
thanks zion