[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 og find



David Bo Jensen wrote:
Hej
Jeg kender find, men jeg forstår ikke prune og -name "*~" i nedenstående.Jeg formoder at "*~" er et regulært udtryk, men hvad f.eks matcher det?


PATCHFILES=`find $ARCHDIR -name CVS -prune -o \
    -maxdepth 1 -type f ! -name "*~" ! -name ".*" -print`

Hej David

Prøv at læse man siden til find i stedet for at formode :-) find's liste over argumenter kan til tider virke skræmmende, men den er nu ikke så slem endda.

-name pattern matcher filens navn ud med patterns der minder lidt om dem du kender fra shell'en. "*~" matcher altså filer hvis navn slutter på "~" hvilket ofte er backup filer efterladt af en teksteditor.

-prune bruger jeg ikke selv så meget, men den betyder vist i dette tilfælde at den ikke vil dykke ned i CVS biblioteket

Hvis du vil bruge regulære udtryk på filnavne skal du kigge på -regex i man siden.

MvH
Martin Skøtt


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-11-01, 02:01 CET [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] *