rcmod - Run a given command and modify its Return Code according to the rules given by the user



NAME

rcmod - Run a given command and modify its Return Code according to the rules given by the user


SYNOPSIS

rcmod [<FROM>=<TO> [<FROM>=<TO> [...]]] <COMMAND> [<ARGS>]


DESCRIPTION

If COMMAND returned with code FROM then rcmod(1) returns with TO. FROM may be a comma-delimited list. Keyword any means any return code not specified in FROM parameters. Keyword same makes the listed exit codes to be preserved.

  rcmod any=0 1=13 2,3=same user-command

It runs user-command, then exits with status 13 if user-command exited with 1, 2 if 2, 3 if 3, and 0 for any other return value.

If COMMAND was terminated by a signal, rcmod(1) exits with 128 + signal number like bash(1) does.

 rcmod - Run a given command and modify its Return Code according to the rules given by the user