[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Infinite loop in mdate-sh
From: |
James Youngman |
Subject: |
Re: Infinite loop in mdate-sh |
Date: |
Wed, 8 Jun 2005 22:50:07 +0100 |
User-agent: |
Mutt/1.3.28i |
On Wed, Jun 08, 2005 at 08:41:21PM +0200, Alexandre Duret-Lutz wrote:
> >>> "James" == James Youngman <address@hidden> writes:
>
> James> +# GNU ls unserstands $TIME_STYLE. Leaving it set at "+%Y-%m-%d
> %H:%M:%S" for
> James> +# example will cause this script to go into an infinite loop.
> James> +unset TIME_STYLE
>
> unset is not portable.
I had not realised, thanks for letting me know.
> Can we override TIME_STYLE with some safe value? Which one?
> What happens when this is set to the empty string?
Well, based on reading the manpage for GNU ls and some testing, try
the following:
: GNU ls changes its time format in response to the TIME_STYLE
: variable, but we cannot unset it since the V7 shell does not have an
: "unset" command. "test" is present in V7 and supports -n but is not
: a shell builtin. V7 /bin/sh does not support hash comments, but
: fortunately it supports :.
if test -n "$TIME_STYLE"
then
if unset TIME_STYLE 2>/dev/null
then
: ok, we got rid of it.
else
: The shell does not provide "unset".
: A posix- prefix means that the style
: takes effect only outside the POSIX
: locale, but we have just selected the
: POSIX locale, so that should be enough
: to turn it off.
TIME_STYLE=posix-"$TIME_STYLE"
fi
fi
: Regards, James.
- Re: Infinite loop in mdate-sh, James Youngman, 2005/06/07
- Re: Infinite loop in mdate-sh, Alexandre Duret-Lutz, 2005/06/08
- Re: Infinite loop in mdate-sh, Vincent Lefevre, 2005/06/08
- Re: Infinite loop in mdate-sh,
James Youngman <=
- Re: Infinite loop in mdate-sh, Stepan Kasal, 2005/06/28
- Re: Infinite loop in mdate-sh, Alexandre Duret-Lutz, 2005/06/29
- Re: Infinite loop in mdate-sh, Stepan Kasal, 2005/06/30
- Re: Infinite loop in mdate-sh, Alexandre Duret-Lutz, 2005/06/30
- Re: Infinite loop in mdate-sh, Stepan Kasal, 2005/06/30