[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] Hvorfor er 0 == 1?



On Mon, 10 Sep 2007, Jens Bang wrote:

Jeg sidder og roder med et bash-script. Og er faldet over noget underligt. Jeg
vil gerne tælle antallet af directories i det aktuelle directory der hedder
noget med backup (altså dem der vises med ls backup*). Reelt hedder de
backup0000, backup0001 osv.

Jeg tæller dem med denne kode:

Sært, hvad hvis du tæller sådan: FileCount=0

ls backup* | while read X
do
   echo $X
   echo $FileCount
   FileCount=$((FileCount+1))
done
echo $FileCount

/hans
--
Horsebakken 78, DK-2400 København NV, Phone: +45 2264 8020
-------------------------------------------------------------
Hvordan beskriver man forhold, der dybest set kun kan beskrives ved
sig selv? Universet, kærligheden, den ufattelige grumhed eller et
måltid.						-- Georg Metz


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-10-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] *