[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 sed



Peter Maersk-Moller wrote:

Øhhh - jeg forstår ikke, hvad du skriver, men man kan gøre noget i stil med

  $ files=`ls -1 |awk '{ printf("%s:",$1) } '`
  $ file3=`echo $files |cut -f 3 -d:`

Det ser fint ud til at virke - tak for det. Kan man istedet for separate variabler (file1, file2....) bruge et array, som i c ?? Dvs. noget i retning af:


file=`echo $files |cut -f 1 -d:`
i=1

while [ "$file" != "" ]; do
files(i)=$file
i=$i+1
file=`echo $files |cut -f $i -d:`
done

således, at jeg får både et filantal (i-1) og filnavnene lagt i et tekstarray. Kan det lade sig gøre ??

MVH Torben

 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 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] *