|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
foreach in csh
I have a foreach loop in a csh script and I noticed that it tries to find the files with the pattern *$searchpt* in the file name. I'm confused as I never specified checking for the files. Code:
foreach f ( *$searchpt* )
set fnew = `echo $f | awk -v searchpat=$searchpt \
-v replacepat=$replacept \
'{sub(searchpat,replacepat); print}'`
endif |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
* says check for files, through shell globbing, unless you quote it.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using sed with a foreach loop | Peggy White | Shell Programming and Scripting | 2 | 01-24-2009 08:37 AM |
| foreach statement in ksh | asulli01 | UNIX for Dummies Questions & Answers | 8 | 11-26-2008 02:55 PM |
| foreach loop | ROOZ | Shell Programming and Scripting | 3 | 06-05-2008 03:20 PM |
| using foreach loop | sam4now | Shell Programming and Scripting | 6 | 04-26-2008 11:22 AM |
| foreach command ?! | geoquest | UNIX for Dummies Questions & Answers | 5 | 05-20-2002 05:11 PM |
|
|