![]() |
|
|
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 |
| list tunable parameters and its values (Solaris 8) | danielsf | SUN Solaris | 2 | 01-08-2009 05:41 AM |
| Need to find only unique values for a given tag across the files | sudheshnaiyer | UNIX for Dummies Questions & Answers | 8 | 09-03-2007 01:53 AM |
| How to Find AIX system parameters | R00tSc0rpi0n | UNIX for Advanced & Expert Users | 1 | 01-25-2007 01:56 AM |
| Is it possible to find parameters? | J_ang | Shell Programming and Scripting | 2 | 06-23-2006 03:58 PM |
| Passing Parameters and getting values back from a c program to Shell script | Rajeshsu | High Level Programming | 5 | 08-22-2005 04:12 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
using a vaiable parameters and values to find and tar
This one took HOURS and HOURS of my life. Hopefully this post will save someone the same grief.
I am using "-regex" with "find" via a variable. If I echo the command that is constructed, it looks OK. When I paste the echoed text it to the command line it runs fine. But inside the script it generates an error. This led me to the work around which was to pipe the echoed text to bash. here is the snippet from the script that matters (using GNU bash, version 3.2.33(1)-release (x86_64-redhat-linux-gnu) - Fedora 8): echo find "$FOLDER" -type f $EXCLUDE find "$FOLDER" -type f $EXCLUDE echo find "$FOLDER" -type f $EXCLUDE | bash here is the output from above 3 lines: find etc -type f -not \( -regex '^etc/X11/.*' -o -regex '^etc/fonts/.*' \) find: paths must precede expression Usage: find [-H] [-L] [-P] [path...] [expression] etc/bla etc/foo My question is why does the command not work in the script when it works fine on the command line or when piped to bash? |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|