[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]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Hej! On 090310 23:56, Atte André Jensen wrote: > 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. printf är väl en lösning. t.ex: for file in `ls *.pl`; do printf '%-16s %8d ALIGN\n' "$file" "`stat -c %Y $file`"; done output: deny.pl 1236725431 ALIGN netlogon.pl 1232640416 ALIGN -- Olof Johansson <sslug@sslug> http://www.ethup.se 0x7FC0FBBA
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |