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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
rsh script with inside a for loop trekianov Shell Programming and Scripting 5 12-06-2008 12:39 PM
Script not executing second loop thumper Shell Programming and Scripting 2 05-07-2008 04:10 PM
Problems with an if/then loop within a script lodey Shell Programming and Scripting 3 09-18-2007 02:45 AM
script to loop around folders grinder182533 Shell Programming and Scripting 2 11-14-2006 08:46 AM
If then else loop in Shell script pankajkrmishra Shell Programming and Scripting 4 07-31-2006 09:40 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-08-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
  #2 (permalink)  
Old 09-09-2004
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,115
There is a "true" command that does nothing except set the exit code. So you could do:

while true ; do
done

to have an infinite loop. The bourne shell also has a ":" command that does nothing. It is built-in to the shell so it is faster that "true" which is external. So a second option is:

while : ; do
done

The syntax looks weird, but this is used a lot in sh scripts.
  #3 (permalink)  
Old 09-09-2004
moxxx68's Avatar
moxxx68 moxxx68 is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 301
Thumbs up char!

thanx for the input!
will try.................................!
thanx moxxx68
  #4 (permalink)  
Old 09-09-2004
moxxx68's Avatar
moxxx68 moxxx68 is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 301
Talking It worked!!!

thanx for the input again! as soon as I made the change it worked.. WoW!
thanx moxxx68
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0