Image

Imageeugeneteo wrote in Imagelinux

Sort and Exit Codes Inconsistency

"$ sort < a ; echo $?
bash: a: No such file or directory
1
but the manpage says sort returns error >1 if an error occur... any idea or is it just inconsistancy?"

and in man -s2 intro, it says:
" 2 ENOENT
No such file or directory

A file name is specified and the file should exist but
doesn't, or one of the directories in a path name does
not exist."

which is the same as my program:

$ ./a.out sort L10Q1.ca
bad open: No such file or directory
2

Any ideas? My program does a sort < L10Q1.ca redirection. a mixture of pipe, fork, execlp, wait, etc.

I am using:
$ uname -a
SunOS hostname 5.8 Generic_108528-16 sun4u sparc SUNW,Sun-Fire

man -s1 sort
SunOS 5.8 Last change: 13 Jan 1999