exec

From wikieduonline
Revision as of 07:33, 3 November 2022 by Welcome (talk | contribs)
Jump to navigation Jump to search

https://man7.org/linux/man-pages/man1/exec.1p.html

Open YOUR_FILE_TO_READ as file descriptor 3 for reading:
exec 3< YOUR_FILE_TO_READ
exec $SHELL

exec in Bash[1]


#!/bin/bash -

exec > >(tee "$HOME/somefile.log") 2>&1

echo "$HOME"
echo hi
date
date +%F
echo bye 1>&2

Related commands

See also

  • https://askubuntu.com/questions/525767/what-does-an-exec-command-do
  • Advertising: