Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ exec(1SH) — UTek W2.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

break(1sh)

cd(1sh)

chdir(1sh)

continue(1sh)

csh(1csh)

echo(1sh)

eval(1sh)

exec(1csh)

exit(1sh)

export(1sh)

hash(1sh)

login(1)

pwd(1sh)

read(1sh)

readonly(1sh)

return(1sh)

set(1sh)

sh(1sh)

shift(1sh)

test(1sh)

times(1sh)

trap(1sh)

type(1sh)

ulimit(1sh)

umask(1sh)

unset(1sh)

wait(1sh)

which(1sh)

execve(2)



EXEC(1SH)               COMMAND REFERENCE               EXEC(1SH)



NAME
     exec - executes arguments without creating a new process (sh
     built-in)

SYNOPSIS
     exec [ arg . . .  ]

DESCRIPTION
     The command specified by arg, is executed in place of this
     shell without creating a new process.  Input/output
     arguments may appear and, if no other arguments are given,
     cause the shell input/output to be modified.

     The builtin sh command login is equivalent to the command
     exec login ...

EXAMPLES
     The system has a limit on the number of processes that can
     exist at any time and a limit on the number of active
     processes for each user (typically 20).  The average user
     will very rarely reach this limit, but sometimes a number of
     processes will get caught in infinite loops or run for a
     long time.  When this happens, the user can not kill any of
     the processes because one process slot is required to
     execute kill.

     In this situation, the command



          exec kill -9 0


     will kill all processes currently running. Of course, this
     means that the user must log in again, but as stated before,
     this happens very rarely.

     The following shell script fragment uses exec with no
     arguments to internally redirect the standard output.



          #!/bin/sh
          if test \( $# -ge 2 \) -a \( "x$1" = "x-f" \)
          then
               exec > "$2"
               shift
               shift
          fi
          other commands ...





Printed 10/17/86                                                1





EXEC(1SH)               COMMAND REFERENCE               EXEC(1SH)



RETURN VALUE
     Exec returns the exit status of the command executed. If the
     command does not exist, the exit code will be NOCMD.

SEE ALSO
     break(1sh), cd(1sh), chdir(1sh), continue(1sh), csh(1csh),
     echo(1sh), eval(1sh), exec(1csh), exit(1sh), export(1sh),
     hash(1sh), login(1), pwd(1sh), read(1sh), readonly(1sh),
     return(1sh), set(1sh), sh(1sh), shift(1sh), test(1sh),
     times(1sh), trap(1sh), type(1sh), ulimit(1sh), umask(1sh),
     unset(1sh), wait(1sh), which(1sh), execve(2).












































Printed 10/17/86                                                2





































































%%index%%
na:72,115;
sy:187,113;
de:300,510;
ex:810,1122;
rv:2076,271;
se:2347,892;
%%index%%000000000107

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026