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
Using variables created sequentially in a loop while still inside of the loop [bash] DeCoTwc Shell Programming and Scripting 2 06-23-2009 05:59 PM
Script - Filter data - repeated loop - Help needed... vasanth_vadalur Shell Programming and Scripting 15 06-17-2009 07:55 AM
loop needed? adarii Shell Programming and Scripting 4 07-04-2008 04:22 AM
For loop help needed arund_01 UNIX for Dummies Questions & Answers 3 06-25-2008 10:15 AM
NEED HELP PLZ! While Loop script needed! scoobydoo Shell Programming and Scripting 1 03-03-2005 12:56 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-13-2009
jojo123 jojo123 is offline
Registered User
  
 

Join Date: May 2009
Posts: 51
if loop help needed

Dear All,

Please help me out for the below query

Code:
echo 'please input file type (i.e file1,file2,file3,file4): '
read a
cat hello.wri | grep $a | wc -l > temp1.wri
cat hello.wri | grep $a | wc -l > temp2.wri
cat hello.wri | grep $a | wc -l > temp3.wri
cat hello.wri | grep $a | wc -l > temp4.wri
now the query is that it depends upon user, which filetype wil he use (i.e. file1,file2,file3,file4)
i want that if subscriber write file3
than only temp3.wri should be created and the rest command should be skipped and no files for temp1.wri,temp2.wri
temp4.wri should be generated. only files for temp3.wri should be generated
as per my understanding, (if) loop will be used


please advice
 

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 07:08 PM.


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