Name: Anonymous 2011-02-09 2:44
/prog/
Newfriend too stoned to detect the problem with this problem and I gotta submit ASAP. Can /prog/ take a look at this
#!/bin/bash
echo "Hello, $LOGNAME"
echo "Current date is `date` "
echo "User is `whoami` "
echo "Current directory `pwd` "
echo "Please press your choice (1-Contents of folders, 2-No of files/folders)"
read choice
if [ $choice = "1" ]; then
for FILE in *
do
if [ -s $FILE ]; then
echo "$FILE has content"
else
echo "$FILE is empty or not a folder"
fi
done
exit 1
if [ $choice = "2" ]; then
for FILE in *
do
if [ -d $FILE ]; then
echo "$FILE is a directory"
else
echo "No of files in directory : $(grep [^*$] $FILE -c)"
fi
done
exit 1
else
exit 9
fi
I have to submit a shell script that list all files and calculate the number of files using decision. Please help me /prog/
Newfriend too stoned to detect the problem with this problem and I gotta submit ASAP. Can /prog/ take a look at this
#!/bin/bash
echo "Hello, $LOGNAME"
echo "Current date is `date` "
echo "User is `whoami` "
echo "Current directory `pwd` "
echo "Please press your choice (1-Contents of folders, 2-No of files/folders)"
read choice
if [ $choice = "1" ]; then
for FILE in *
do
if [ -s $FILE ]; then
echo "$FILE has content"
else
echo "$FILE is empty or not a folder"
fi
done
exit 1
if [ $choice = "2" ]; then
for FILE in *
do
if [ -d $FILE ]; then
echo "$FILE is a directory"
else
echo "No of files in directory : $(grep [^*$] $FILE -c)"
fi
done
exit 1
else
exit 9
fi
I have to submit a shell script that list all files and calculate the number of files using decision. Please help me /prog/