exec

From RaySoft

Replace the shell with the given command.[1]

Documentation

Syntax

exec [PARAMETER ...] [COMMAND [PARAMETER ...]] [REDIRECTION ...]

Examples

Redirect stderr to stdout in the current shell
NOTE:
This is very helpful when using online compilers like Ideone.com.
exec 2>&1
Redirect all output (stdout & stderr) to a file
exec >>"${logs}/my_app.log" 2>&1

date '+%n----- %F %T -----'

References

  1. bash -c 'help exec'