Difference between revisions of "Exec"
Jump to navigation
Jump to search
↑ https://askubuntu.com/questions/525767/what-does-an-exec-command-do
(27 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
− | Open YOUR_FILE_TO_READ as file descriptor 3 for reading: | + | {{lowercase}} |
+ | 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 3< YOUR_FILE_TO_READ | ||
+ | exec [[$SHELL]] | ||
− | + | <code>[[exec (Bash)|exec]]</code> in [[Bash]] <ref>https://askubuntu.com/questions/525767/what-does-an-exec-command-do</ref> | |
+ | |||
+ | |||
+ | https://unix.stackexchange.com/questions/61931/redirect-all-subsequent-commands-stderr-using-exec | ||
+ | |||
+ | #![[/bin/bash]] - | ||
+ | |||
+ | exec > >(tee "$HOME/somefile.log") 2>&1 | ||
+ | |||
+ | echo "$HOME" | ||
+ | echo hi | ||
+ | date | ||
+ | date +%F | ||
+ | echo bye 1>&2 | ||
== Related commands == | == Related commands == | ||
* <code>[[tail]]</code> | * <code>[[tail]]</code> | ||
− | * <code>[[exec]]</code> <code>[[mount]]</code> option. | + | * <code>[[exec]]</code> <code>[[mount]]</code> [[mount options|option]]. |
+ | * <code>[[flock]]</code> | ||
+ | * <code>[[shopt -s execfail]]</code> | ||
+ | * <code>[[cloud-init]]</code> | ||
+ | * <code>[[cabal exec]]</code> | ||
+ | * [[Terraform provider: Kubernetes]] | ||
+ | * <code>[[kubectl exec]]</code> | ||
+ | * <code>[[exec /usr/local/bin/docker-entrypoint.sh: exec format error]]</code> | ||
+ | * [[Amazon ECS Exec Checker]] | ||
+ | * [[Type=exec]] | ||
+ | * [[K8s probes]] | ||
+ | * [[subprocess.run]] | ||
+ | |||
+ | == Activities == | ||
+ | * Read https://unix.stackexchange.com/questions/tagged/exec?tab=Votes | ||
== See also == | == See also == | ||
− | * | + | * {{stdin}} |
* {{Bash}} | * {{Bash}} | ||
+ | |||
+ | [[Category:Bash]] |
Latest revision as of 10:31, 8 November 2024
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
https://unix.stackexchange.com/questions/61931/redirect-all-subsequent-commands-stderr-using-exec
#!/bin/bash - exec > >(tee "$HOME/somefile.log") 2>&1 echo "$HOME" echo hi date date +%F echo bye 1>&2
Related commands[edit]
tail
exec
mount
option.flock
shopt -s execfail
cloud-init
cabal exec
- Terraform provider: Kubernetes
kubectl exec
exec /usr/local/bin/docker-entrypoint.sh: exec format error
- Amazon ECS Exec Checker
- Type=exec
- K8s probes
- subprocess.run
Activities[edit]
See also[edit]
- Standard streams:
/dev/stdin
,/dev/stdout
,/dev/stderr
,/dev/null
, File descriptor,set -x, 2>&1, stdbuf
Bash [ -c ]
,alias
,&&
, Bash history, Autocompletion,set
,unset
,export
,.bash_aliases, .bashrc and .bash profile
,PS1
,echo
,brace expansion
, Function,shopt
,trap
,set -e
,source
,PATH
,complete
,disown
,.hushlogin
,.bashrc
,builtin
,eval
,set
,$PATH
,$HOME
,TZ
,.profile
,-e, -i
,Builtin (Bash)
,mapfile
,~
, return (Bash), for, until,declare, dirname, basename, functions.sh
, Bash arithmetic expansion,shift, bash --rcfile, readonly, $1, $@
Advertising: