![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Directory sizes loop optimization | la_womn | Shell Programming and Scripting | 6 | 05-16-2008 08:05 PM |
| loop through the directory for files and sort by date and process the first file | dsdev_123 | AIX | 1 | 01-30-2008 01:31 PM |
| changing filenames in a directory to a number within a loop | visitorQ | Shell Programming and Scripting | 30 | 12-13-2007 09:43 PM |
| copy files from one directory to another directory | zip_zip | UNIX for Dummies Questions & Answers | 5 | 09-14-2003 03:16 PM |
| moving files from a unix directory to a windows directory | gleads | UNIX for Dummies Questions & Answers | 2 | 08-29-2002 05:42 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Loop through files in a directory
Hi,
I want to write bash script that will keep on looking for files in a directory and if any file exists, it processes them. I want it to be a background process, which keeps looking for files in a directory. Is there any way to do that in bash script? I can loop through all the files like this: for i in `ls -1 \dirname\*` do .... done I can make it an endless loop llike this while [ true ] do done Thanks for all you help. R |
| Forum Sponsor | ||
|
|
|
||||
|
Quote:
The & makes the script remain alive throughout. If done as a cron job, then once the job is done, the script exits until it is called again. My 2 cents, Vino |