[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
 

pad'e en string i bash



Hejsa

Jeg vil gerne pad'e en string i bash. Følgende lille bogus script viser problemstillingen:

#!/bin/bash
for file in `ls *.txt`; do
    echo $file `stat -c %Y $file` ALIGN
done

sslug@sslug:~$ pad.sh
anagrammer_oeveoptagelser_track_list.txt 1232703567 ALIGN
jack_update.txt 1234444855 ALIGN
test.txt 1226059095 ALIGN

Men jeg ønsker fx:
anagrammer_oeveoptagelser_track_list.txt     1232703567    ALIGN
jack_update.txt                              1234444855    ALIGN
test.txt                                     1226059095    ALIGN

Og hvis anden kolonne havde haft varierende bredde:
anagrammer_oeveoptagelser_track_list.txt     1232703567    ALIGN
jack_update.txt                                      55    ALIGN
test.txt                                        6059095    ALIGN

Hvordan gøres dette smartest i bash. Måske skal jeg slet ikke pad'e, men gribe det an på en anden måde.

--
Atte


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

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