Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What does code 123 mean?... (Shell command failed with code 123 and no output)

8,021 views
Skip to first unread message

Don Saklad

unread,
Jun 6, 2008, 2:34:22 AM6/6/08
to help-gn...@gnu.org, dsa...@gnu.org
a.
What does code 123 mean?... in

(Shell command failed with code 123 and no output)


b.
Where is there a list of codes and what the codes mean?...


Xah

unread,
Jun 6, 2008, 3:30:48 AM6/6/08
to
Don Saklad wrote:
«What does code 123 mean?... in (Shell command failed with code 123
and no output)»

possibly the exit code of unix shell commands...

Here's a excerpt from “perldoc -f system”

The return value is the exit status of the program as returned by the
"wait" call. To get the actual exit value, shift right by eight (see
below). See also "exec". This is *not* what you want to use to
capture the output from a command, for that you should use merely
backticks or "qx//", as described in "`STRING`" in perlop. Return
value of -1 indicates a failure to start the program or an error of
the wait(2) system call (inspect $! for the reason).

So you might also see:

man 2 wait
man 3 exit
http://en.wikipedia.org/wiki/Exit_status#Unix

Xah
x...@xahlee.org
http://xahlee.org/


Tim X

unread,
Jun 6, 2008, 7:45:50 PM6/6/08
to
Don Saklad <dsa...@gnu.org> writes:

> a.
> What does code 123 mean?... in
>
> (Shell command failed with code 123 and no output)
>

This is usually the exit status from the shell command you are
running. Sometimes, programs that run commands will do a logical AND of
the return value from the command and some other value, which can be
used to indicate errors in executing the command rather than errors in
the comamnd itself and you will need to do a bit shift to get the actual
error code.

>
> b.
> Where is there a list of codes and what the codes mean?...
>

There isn't any standard list. There are some conventions on the use of
error codes, but many programs don't follow them. The best place to
check is probably the man page or other documentation for the command
you are running. Also, check the definition of shell-command - you can
call it with a 3rd argument that specifies a buffer for errors to be
sent to (i.e. shell commands stderr). Calling it with this set may give
you some clue as to what is going on.

HTH

Tim

--
tcross (at) rapttech dot com dot au

Don Saklad

unread,
Jun 7, 2008, 12:16:00 AM6/7/08
to help-gn...@gnu.org, dsa...@gnu.org
> Which command was that? The interpretation of the code
> depends on the command which returned that code.

Around the web where are there examples of commands that could return
code 123 ?...

In this particular case it happened to be...
find -type f -print0 | xargs -0 grep -i strategylab


_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


a.
What does code 123 mean?... in

(Shell command failed with code 123 and no output)

Johan Bockgård

unread,
Jun 7, 2008, 5:04:20 AM6/7/08
to
Don Saklad <dsa...@gnu.org> writes:

> In this particular case it happened to be...
> find -type f -print0 | xargs -0 grep -i strategylab
>
>
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> a.
> What does code 123 mean?... in
>
> (Shell command failed with code 123 and no output)

EXIT STATUS
xargs exits with the following status:
0 if it succeeds
123 if any invocation of the command exited with status 1-125
124 if the command exited with status 255
125 if the command is killed by a signal
126 if the command cannot be run
127 if the command is not found
1 if some other error occurred.

Exit codes greater than 128 are used by the shell to indicate
that a
program died due to a fatal signal.

> b.
> Where is there a list of codes and what the codes mean?...

man xargs

--
Johan Bockgård

Peter Dyballa

unread,
Jun 7, 2008, 6:10:19 AM6/7/08
to Johan Bockgård, help-gn...@gnu.org

Am 07.06.2008 um 11:04 schrieb Johan Bockgård:

> EXIT STATUS
> xargs exits with the following status:
> 0 if it succeeds
> 123 if any invocation of the command exited with status 1-125
> 124 if the command exited with status 255
> 125 if the command is killed by a signal
> 126 if the command cannot be run
> 127 if the command is not found
> 1 if some other error occurred.
>
> Exit codes greater than 128 are used by the shell to
> indicate
> that a
> program died due to a fatal signal.


You have a complicated xargs! Look, mine from FreeBSD, only offers:

DIAGNOSTICS
The xargs utility exits with a value of 0 if no error occurs.
If utility
cannot be found, xargs exits with a value of 127, otherwise if
utility
cannot be executed, xargs exits with a value of 126. If any
other error
occurs, xargs exits with a value of 1.

--
Greetings

Pete

Engineer: a mechanism for converting caffeine into designs

0 new messages