Re: built-in '[' and '/usr/bin/[' yield different results

2018-11-13 Thread Eric Blake
On 11/13/18 10:29 AM, Service wrote:     # ensure that file1 exists and that file2 does not exist There's your problem. It is inherently ambiguous what timestamp to use when a file is missing (infinitely new or infinitely old, or always an error for not existing); bash's -nt picked one way,

Re: built-in '[' and '/usr/bin/[' yield different results

2018-11-13 Thread Ilkka Virta
On 13.11. 18:29, Service wrote:     # Put the above commands into a script, say check.sh     # Run with: /bin/sh < check.sh     # Or  : /bin/sh ./check.sh     # Or  : /usr/bin/env ./check.sh     # Output is always not ok:     not_nt     nt $ cat check.sh export PATH=""

Re: built-in '[' and '/usr/bin/[' yield different results

2018-11-13 Thread Greg Wooledge
On Tue, Nov 13, 2018 at 05:29:42PM +0100, Service wrote: > Repeat-By: >     Under Windows 10, WSL. Then why did you send this to a debian.org address? >     Start "bash", terminal with shell pops up. >     2. This does not work: > >     # Put the above commands into a script, say check.sh >   

built-in '[' and '/usr/bin/[' yield different results

2018-11-13 Thread Service
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale'