problems with the %h flag to the date command

2003-01-14 Thread David A. Case
Several of my scripts are failing because date doesn't seem to properly
recognize the %h flag.  According to the docs:

% man date

NAME
   date - print or set the system date and time
..

   %b locale's abbreviated month name (Jan..Dec)
..
   %h same as %b
..


But here is my experience:

% date +%d%b%y 
14Jan03

% date +%d%h%y
1403

The %h argument works as advertised on RedHat Linux, and on several
Unices.  So, this has the earmarks of a cygwin-specific problem.

I could not find any mention of this at the FAQ or mailing lists.  My
cygwin installation (Windows XP Pro) is no more than a few days old
(cygcheck output attached...)

There is an obvious work-around, but not one that I can see that avoids
propagating changes (%h - %b) back to Unix origins of a reasonably large
number of scripts.

..thanks!...dave case



Cygwin Win95/NT Configuration Diagnostics
Current System Time: Tue Jan 14 20:14:54 2003

Windows XP Professional Ver 5.1 Build 2600 

Path:   .
C:\cygwin\usr\local\aspell
C:\cygwin\home\case\bin
C:\cygwin\home\case\amber8\exe-3
C:\cygwin\home\case\nab5\bin
C:\cygwin\usr\local\wnprun\bin
C:\cygwin\usr\local\rdb
C:\cygwin\usr\X11R6\bin
C:\cygwin\usr\local\bin
C:\cygwin\bin
C:\cygwin\bin
c:\Program Files\Intel\Compiler70\IA32\Bin
c:\WINDOWS\system32
c:\WINDOWS
c:\WINDOWS\System32\Wbem
c:\PROGRAM FILES\THINKPAD\UTILITIES
c:\MSDEV\BIN

SysDir: C:\WINDOWS\System32
WinDir: C:\WINDOWS

CYGWIN = `ntsec'
HOME = `C:\cygwin\home\case'
MAKE_MODE = `unix'
PWD = `/home/case'
USER = `case'

ALLUSERSPROFILE = `C:\Documents and Settings\All Users'
AMBERHOME = `/home/case/amber8'
APPDATA = `C:\Documents and Settings\case\Application Data'
COLORFGBG = `0;default'
COLORTERM = `rxvt-xpm'
COMMONPROGRAMFILES = `C:\Program Files\Common Files'
COMPUTERNAME = `QUINE'
COMSPEC = `C:\WINDOWS\system32\cmd.exe'
CVSROOT = `gamow.scripps.edu:/thr/gamow/cvsroot'
CVS_RSH = `rsh'
CVS_SERVER = `/usr/local/bin/cvs'
CYGWIN_ROOT = `\cygwin'
DELDIR = `/usr/local/qnifft22'
DISPLAY = `127.0.0.1:0.0'
DMF_PRESERVE = `1'
DOMAIN = `.scripps.edu'
ECHONOCR = `-n'
EDITOR = `/usr/bin/vim'
GRACE_HOME = `/usr/local/grace'
HOMEDRIVE = `C:'
HOMEPATH = `\Documents and Settings\case'
INCLUDE = `C:\MSDEV\INCLUDE'
INTEL_LICENSE_FILE = `C:\Program Files\Common Files\Intel\Licenses'
LIB = `C:\MSDEV\LIB'
LOGNAME = `case'
LOGONSERVER = `\\QUINE'
MAILCHECK = `999'
MANPAGER = `less -R'
MANPATH = `:/usr/ssl/man:/usr/ssl/man'
NABHOME = `/home/case/nab5'
NUMBER_OF_PROCESSORS = `1'
OLDPWD = `/home/case/amber8'
OS = `Windows_NT'
PALMTOPCENTERDIR = `C:\Program Files\Sharp\Qtopia Desktop'
PARBODY = `._A_a'
PARINIT = `Rgqr'
PARQUOTE = `_s|'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 6 Model 11 Stepping 1, GenuineIntel'
PROCESSOR_LEVEL = `6'
PROCESSOR_REVISION = `0b01'
PROGRAMFILES = `C:\Program Files'
PROMPT = `quine%% '
RTF2LATEX2E_DIR = `/usr/local/rtf2latex2e'
SESSIONNAME = `Console'
SHELL = `/bin/zsh'
SHIFTSHOME = `/home/case/shifts'
SHLVL = `2'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINDOWS'
TEMP = `c:\DOCUME~1\case\LOCALS~1\Temp'
TERM = `rxvt'
TMP = `c:\DOCUME~1\case\LOCALS~1\Temp'
TZ = `PST8PDT'
USERDOMAIN = `QUINE'
USERNAME = `case'
USERPROFILE = `C:\Documents and Settings\case'
VISUAL = `/usr/bin/vim'
WINDIR = `C:\WINDOWS'
WINDOWID = `8388611'
_ = `/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x0022
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x0022
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `C:/cygwin'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = `C:/cygwin/bin'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = `C:/cygwin/lib'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/X11R6/lib/X11/fonts
  (default) = `C:\cygwin\usr\X11R6\lib\X11\fonts'
  flags = 0x000a
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options

c:  hd  NTFS   44725Mb  26% CP CS UN PA FC @ ', ' D

.  /cygdrive userbinmode,cygdrive
C:/cygwin  / system  binmode
C:/cygwin/bin  /usr/bin  system  binmode
C:/cygwin/lib  /usr/lib  system  binmode
C:\cygwin\usr\X11R6\lib\X11\fonts  

qRE: problems with the %h flag to the date command

2003-01-14 Thread Robert McNulty Junior
Same results here.
Perhaps a bug in Date.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of David A. Case
Sent: Tuesday, January 14, 2003 10:38 PM
To: [EMAIL PROTECTED]
Subject: problems with the %h flag to the date command


Several of my scripts are failing because date doesn't seem to properly
recognize the %h flag.  According to the docs:

% man date

NAME
   date - print or set the system date and time
..

   %b locale's abbreviated month name (Jan..Dec)
..
   %h same as %b
..


But here is my experience:

% date +%d%b%y 
14Jan03

% date +%d%h%y
1403

The %h argument works as advertised on RedHat Linux, and on several
Unices.  So, this has the earmarks of a cygwin-specific problem.

I could not find any mention of this at the FAQ or mailing lists.  My
cygwin installation (Windows XP Pro) is no more than a few days old
(cygcheck output attached...)

There is an obvious work-around, but not one that I can see that avoids
propagating changes (%h - %b) back to Unix origins of a reasonably large
number of scripts.

..thanks!...dave case




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/




Re: problems with the %h flag to the date command

2003-01-14 Thread Christopher Faylor
On Tue, Jan 14, 2003 at 08:37:54PM -0800, David A.  Case wrote:
Several of my scripts are failing because date doesn't seem to properly
recognize the %h flag.  According to the docs:

% man date

NAME
   date - print or set the system date and time
..

   %b locale's abbreviated month name (Jan..Dec)
..
   %h same as %b
..

Apparently newlib isn't implementing the '%h' option in its version of
strftime.  I'll submit a patch to newlib.

I'll also implement '%l' and '%k' while I'm at it.

A fix for this will be in 1.3.19, coming soon, to a...

No wait a minute, I forgot I was going to be mean and hold onto 1.3.19
for a while...

Bwaha, etc.

cgf

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/