The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-09-2004
moxxx68's Avatar
moxxx68 moxxx68 is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 301
Thumbs up not quite sure how to loop this script!

can anyone tell me how to make this script continue after the *)
I have been reading C and shell scripting and am confused.. I tried to impliment a while (1) and a continue after the *) but I keep getting end of file error..! also there a few different loops that I am not sure which type to use.

# !/bin/sh
# .file_manager

function usage () { echo "choose from named parameters ... txt or Txt, loc or Loc, fle or Fle,fls or Fls,E or e"; echo "capital for text, lowercase for directories
and files"; echo "Exec & EXEC only uppercase..!"; }


usage
read type
case $type in
Txt) ls -ali -R . | grep -nB2 "(Txt)" * |less
break;
;;
Loc) ls -ali -R . | grep -nB2 "(Loc)" * | less
break;
;;
Fle) ls -ali -R . | grep -nB2 "(Fle)" * | less
break;
;;
Fls) ls -ali -R . | grep -nB2 "(Fls)" * | less
break;
;;
E) ls -ali -R . | grep -nB2 "(E)" * | less
break;
;;
Exec) ls -ali -R . | grep -nB2 "(Exec)" * | less
break;
;;
EXEC) ls -ali -R . | grep -nB2 "(EXEC)" * | less
break;
;;
txt) ls -ali -R . | grep -n 'txt' | less
break;
;;
loc) ls -ali -R . | grep -n 'loc' | less
break;
;;
fls) ls -ali -R . | grep -n 'fls' | less
break;
;;
fle) ls -ali -R . | grep -n 'fle' | less
break;
;;
e) ls -ali -R . | grep -n 'E' | less
;;
*)echo "error no such usage choice"
usage
esac
would appreciate..
thanx moxxx68