bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What am I missing?


From: abi
Subject: What am I missing?
Date: Sat, 1 Sep 2007 18:51:34 -0500 (CDT)
User-agent: SquirrelMail/1.4.9a

Hi,

I am having trouble running a command in a shell script that runs without
a problem on the command line. Consider the following script:

========================================================================

#!/bin/bash

entry="/cygdrive/c/Documents\ and\ Settings/arroyoa/Desktop"
exclude="-wholename '/cygdrive/c/Documents and
Settings/arroyoa/Desktop/asdf' -prune -o"

#find "/cygdrive/c/Documents and Settings/arroyoa/Desktop/" -wholename
'/cygdrive/c/Documents and Settings/arroyoa/Desktop/asdf' -prune -o -print

   OFS="${IFS}"
   IFS=$'\n'

    echo "find "$entry" $exclude -print"
for j in `find "$entry" $exclude -print`; do
   echo "$j"
done

========================================================================

If you run the script above you will find the following output:

find /cygdrive/c/Documents\ and\ Settings/arroyoa/Desktop -wholename
'/cygdrive/c/Documents and Settings/arroyoa/Desktop/asdf' -prune -o -print
find: unknown predicate `-wholename '/cygdrive/c/Documents and
Settings/arroyoa/Desktop/asdf' -prune -o'

Then if you copy the command that was echoed and run it (find
/cygdrive/c/Documents\ and\ Settings/arroyoa/Desktop -wholename
'/cygdrive/c/Documents and Settings/arroyoa/Desktop/asdf' -prune -o
-print) then you no longer receive the error. What am I missing from the
script so that I can exclude these directories?

Thanks,
Abi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]