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

Re: Bash-Script: Denkfehler, aber wo?



Am 2005-07-26 19:10:13, schrieb Christoph Conrad:
> Hallo,
> 
> wo mache ich hier den Fehler?
> 
> # INCLUDES=$(find . -name '*.hpp' -exec dirname {} \; | uniq | tr "\r\n" ":")
> 
> find . -name '*.hpp' | while read file
> do
>         dir=$(dirname $file)
>         INCLUDES="$INCLUDES -I $dir"
> done
> 
> echo "$INCLUDES" ist dann ein Leerstring. Bei der auskommentierten
> Variante stehen jede Menge Pfade drin.

Weil eine neue Sub-Shell geöffnet und
die $INCLUDES nicht rückwärts exportiert wird.

> Freundliche Grüße,
>   Christoph

Greetings
Michelle

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature


Reply to: