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=""
 /bin/touch file1
 /bin/rm -f file2
 if          [ file1 -nt file2 ]; then echo nt; else echo not_nt; fi
 if /usr/bin/[ file1 -nt file2 ]; then echo nt; else echo not_nt; fi

 $ bash ./check.sh
 nt
 nt

 $ /bin/sh ./check.sh
 not_nt
 nt

Isn't that Windows Linux thingy based on Ubuntu? /bin/sh isn't Bash by default on Debian and Ubuntu, so it might be you're just not running the script with Bash.


--
Ilkka Virta / itvi...@iki.fi

Reply via email to