Mailinglist Archive: opensuse-de (1212 mails)
| < Previous | Next > |
Re: Bash Problem
- From: David Haller <lists@xxxxxxxxxx>
- Date: Mon, 16 Jun 2008 04:54:54 +0200
- Message-id: <20080616025454.GA11193@xxxxxxxxxxxxxxxxxx>
Hallo,
Am Son, 15 Jun 2008, Alex Winzer schrieb:
[..]
Nein.
Die Dokumentation von date und dem verwendeten strftime besagt was
anderes:
==== info date -> info '(sh-utils)Date directives' ===
`%V'
week number of year with Monday as first day of the week as a
decimal (01...53). If the week containing January 1 has four or
more days in the new year, then it is considered week 1;
otherwise, it is week 53 of the previous year, and the next week
is week 1. (See the ISO 8601: 1988 standard.)
====
==== man 3 strftime ====
%V The ISO 8601:1988 week number of the current year
as a decimal number, range 01 to 53, where week 1
is the first week that has at least 4 days in the
current year, and with Monday as the first day of
the week. See also %U and %W. (SU)
====
Woche="`date '+%05V. KW'`"
^ die 5 zur Verdeutlichung ;)
Für zweistellig reicht auch das simple %V:
$ date -d 2008/1/1 '+%V. KW'
01. KW
$ date -d 2008/1/1 '+%1V. KW'
1. KW
$
Siehe auch 'man 3 strftime'. Auch interessant in dem Kontext dürfte
'man 3 printf' sein.
HTH,
-dnh
--
I'm extremely disappointed. I send you out for exciting, new designer drugs,
you come back with tomato sauce. -- Dr. House
--
Um die Liste abzubestellen, schicken Sie eine Mail an:
opensuse-de+unsubscribe@xxxxxxxxxxxx
Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken
Sie eine Mail an: opensuse-de+help@xxxxxxxxxxxx
Am Son, 15 Jun 2008, Alex Winzer schrieb:
[..]
vermute, dass es schlicht '1' sein wird.
Nein.
Dann müsste ich mein Skript um
eine Abfrage erweitern und eine '0' davor schreiben, um die einstelligen
Wochen vor den anderen angezeigt zu bekommen.
Die Dokumentation von date und dem verwendeten strftime besagt was
anderes:
==== info date -> info '(sh-utils)Date directives' ===
`%V'
week number of year with Monday as first day of the week as a
decimal (01...53). If the week containing January 1 has four or
more days in the new year, then it is considered week 1;
otherwise, it is week 53 of the previous year, and the next week
is week 1. (See the ISO 8601: 1988 standard.)
====
==== man 3 strftime ====
%V The ISO 8601:1988 week number of the current year
as a decimal number, range 01 to 53, where week 1
is the first week that has at least 4 days in the
current year, and with Monday as the first day of
the week. See also %U and %W. (SU)
====
Soweit bin ich schon:
#!/bin/bash
Woche=`date +%V`'. KW'
Woche="`date '+%05V. KW'`"
^ die 5 zur Verdeutlichung ;)
Für zweistellig reicht auch das simple %V:
$ date -d 2008/1/1 '+%V. KW'
01. KW
$ date -d 2008/1/1 '+%1V. KW'
1. KW
$
Siehe auch 'man 3 strftime'. Auch interessant in dem Kontext dürfte
'man 3 printf' sein.
HTH,
-dnh
--
I'm extremely disappointed. I send you out for exciting, new designer drugs,
you come back with tomato sauce. -- Dr. House
--
Um die Liste abzubestellen, schicken Sie eine Mail an:
opensuse-de+unsubscribe@xxxxxxxxxxxx
Um eine Liste aller verfuegbaren Kommandos zu bekommen, schicken
Sie eine Mail an: opensuse-de+help@xxxxxxxxxxxx
| < Previous | Next > |