![]() |
|
|
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 |
| Reading filenames with extension .xml | bhalotias | Shell Programming and Scripting | 3 | 01-21-2008 12:02 PM |
| bash: executing commands and reading exit vals | eur0dad | Shell Programming and Scripting | 7 | 07-18-2006 08:42 AM |
| reading long filenames from nero to AIX | categoryzd | UNIX for Dummies Questions & Answers | 1 | 05-18-2006 11:57 AM |
| Bash: Reading 2 arguments from a command line | Vozx | Shell Programming and Scripting | 0 | 12-08-2005 05:23 PM |
| reading filenames inside a program | j_t_kim | UNIX for Dummies Questions & Answers | 5 | 04-04-2002 03:13 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
bash: reading filenames from file
Hi,
I'm trying to write a script that reads filenames from a file and use these filenames in a loop. The filenames are all on one line and the problem is that these filenames have wildcards like * and braces like [0-9] in them. Right now what I'm doing is something like this: echo "reading from file" $1 set -x cat $1 | while read; do line=($REPLY) for file in ${line[@]}; do command $file; echo qsub -j oe -o $log tmp.sh; cat tmp.sh; done done If I do it like this $file contains the wildcards and braces but I would like to loop over all file matching the expressions read in from the file. I've tried doing something like ls $REPLY but it seems that $REPLY contains a single-quoted string so that ls doesn't expand the wildcards and complains about not finding the file instead. Does anyone know how to solve this problem? Thank you very much! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|