![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Simple for loop question | arex876 | Shell Programming and Scripting | 7 | 07-23-2008 04:59 PM |
| while loop question | stepnkev | Shell Programming and Scripting | 2 | 06-01-2007 10:51 AM |
| oracle and loop question | pavan_test | UNIX for Dummies Questions & Answers | 4 | 09-29-2006 12:23 AM |
| Simple while loop question | Brokeback | Shell Programming and Scripting | 3 | 07-21-2006 10:04 AM |
| Loop question | strike | Shell Programming and Scripting | 18 | 04-13-2005 11:24 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
For Loop Question
Hi, I am writing a bash shell script. I will have a section of code devoted to a for loop:
for FILE in *.hdf *.L2; do echo hello world done The complication is that sometimes there will not be any files with a ".hdf" extension, or sometimes there won't be any with a ".L2" extension. Since there are files with other extensions I can't just say "for FILE in *; do". How can I make my script loop through a number of times equal to the amount of files ending in .hdf or .L2, but not care if sometimes either of those filetypes doesn't exist? Mike |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|