[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] Fildatoer og strenge i bash



On Fri, Mar 17, 2006 at 11:08:19PM +0100, Jens Bang wrote:
> On Thursday 16 March 2006 13:31, bjuhn wrote:
> > sslug@sslug ~ $ let a=`stat --format=%y <filnavn> | cut -d '-' -f 1`
> > sslug@sslug ~ $ echo $a
> > 2006
> 
> Og det virker.  :-)
> 
> Tak for det.
> 
> Men nu til en udvidelse:
> 
> Jeg vil gerne opbygge en streng der ser sådan ud:
> 
>      Noget tekst, DD.MM.YYYY HH:MM - (C) Jens Bang YYYY
> 
> Er det muligt i bash? Eller er det nu jeg skal sige til mig selv, at det ikke 
> længere er en scripting opgave, og så bare skrive skidtet i C?
> 
> Det jeg er ude efter, er at få fildatoen fra et JPEG billede, og så bruge det 
> til at opbygge en copyright streng (som den ovenfor), som jeg så kan bruge i 
> et kald til convert, som en form for vandmærke af billedet.

Detta kanske inte är det snyggaste men:

echo Noget tekst, $(ls -la fil.jpg| awk '{print $6 "-" $7}'| \
awk -F\- '{print $3"."$2"."$1" "$4" - (C) Jens Bang "$1}')

Håkan

-- 
Håkan Kvist                  el-post: sslug@sslug
telefon: 0703-14 21 14       hemsida: www.df.lth.se/~hagar


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

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