Public feed
#894245
#!/bin/tcsh
while(1)
printf "\n\n"
cat menu.txt
printf "\n"
printf "\nENTER YOUR SELECTION>"
set input = $<
printf "\n"
if ($input == 'A' || $input == 'a') then
echo "You have chosen to search for a file."
printf "Please Enter the File's Directory name>"
set directory = $<
while (!(-e $directory))
echo "Directory Does not Exist!"
printf "Please Enter the File's Directory name or Q to Exit program>"
set directory = $<
if ($directory == 'Q' || $directory == 'q') then
echo "Exiting Program...We will miss you! :(..."
exit(0)
endif
end
printf "\nPlease Enter the File name you wish to search for>"
set nonomatch
set filename=$<
echo "Looking for file $filename in directory $directory"
find $directory -name "$filename" -type f -print | xargs ls -l
find $directory -name "$filename" -type d -print | xargs ls -ld
else if ($input == 'B' || $input == 'b') then
echo "You have chosen to calculate a file's length."
else if ($input == 'C' || $input == 'c') then
echo "You have chosen to find files of length 0."
else if ($input == 'D' || $input == 'd') then
echo "You have chosen to create backup files."
else if ($input == 'E' || $input == 'e') then
echo "Exiting Program...We will miss you! :(..."
exit(0)
else
echo "None of these choices match [$input]! Please type letters A through E"
endif
end