[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [BASH] parameter expansion



Kristian Nørgaard wrote:
....
> sslug@sslug echo $EXCL
> --exclude '*~'

Det du'er heller ikke.

Prøv at starte bash vha:

bash -x

så kan du se, hvad der går galt:

bash-3.1$ EXCL="--exclude '*~'"
+ EXCL='--exclude '\''*~'\'''
bash-3.1$ tar cvf test.tar $EXCL testdir/
+ tar cvf test.tar --exclude ''\''*~'\''' testdir/
testdir/
testdir/testfil
testdir/testfil~

Du skal lave EXCL vha:

EXCL="--exclude *~"

så virker det:

bash-3.1$ EXCL="--exclude *~"
+ EXCL='--exclude *~'
bash-3.1$ tar cvf test.tar $EXCL testdir/
+ tar cvf test.tar --exclude '*~' testdir/
testdir/
testdir/testfil

bash har selv sat '' omkring *~ når $EXCL bliver
sat ind.

Mogens
-- 
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Fax: +45 33 27 47 08
Email: sslug@sslug Homepage: http://www.crc.dk


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-08-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *