Difference between revisions of "Exec"

From wikieduonline
Jump to navigation Jump to search
 
(16 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 
https://man7.org/linux/man-pages/man1/exec.1p.html
 
https://man7.org/linux/man-pages/man1/exec.1p.html
  Open YOUR_FILE_TO_READ as file descriptor 3 for reading:
+
  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]]
 
  exec [[$SHELL]]
  
<code>exec</code> in [[Bash]]<ref>https://askubuntu.com/questions/525767/what-does-an-exec-command-do</ref>
+
<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
 
https://unix.stackexchange.com/questions/61931/redirect-all-subsequent-commands-stderr-using-exec
<pre>
 
#!/bin/bash -
 
  
exec > >(tee "$HOME/somefile.log") 2>&1
+
#![[/bin/bash]] -
 
+
echo "$HOME"
+
exec > >(tee "$HOME/somefile.log") 2>&1
echo hi
+
date
+
echo "$HOME"
date +%F
+
echo hi
echo bye 1>&2
+
date
</pre>
+
date +%F
 +
echo bye 1>&2
  
 
== Related commands ==
 
== Related commands ==
Line 26: Line 25:
 
* <code>[[exec]]</code> <code>[[mount]]</code> [[mount options|option]].
 
* <code>[[exec]]</code> <code>[[mount]]</code> [[mount options|option]].
 
* <code>[[flock]]</code>
 
* <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 ==

Latest revision as of 10:31, 8 November 2024

Advertising: