Author Topic: Portability of Test Command  (Read 620 times)

Offline scotbuff

  • Sys Admin
  • UNIX User
  • *****
  • Posts: 174
  • Karma: +2/-0
    • View Profile
    • Scott.Buffington.me
Portability of Test Command
« on: December 08, 2006, 10:25:04 am »
The test(1) command
Note that test(1) is a built-in function in many shells.

-e: FILE exists
This seems to be a GNU extension – some shells don't allow -e as an option to test.

HP-UX sh:
$ test -e filename
test: argument expected
In most cases, you can use -r (for file is readable) instead.