meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:bash [2022/11/30 10:04] niziaklinux:bash [2023/11/23 06:57] (current) niziak
Line 1: Line 1:
 ====== Bash ====== ====== Bash ======
-===== rerun as other user =====+ 
 +===== re-run as other user =====
  
 <code bash> <code bash>
 if [ $UID == 0 ]; then if [ $UID == 0 ]; then
-    exec su -c "$0" fos4x+    exec su -c "$0" john
 fi fi
 </code> </code>
Line 15: Line 16:
     exit 1     exit 1
 fi fi
 +</code>
 +
 +and use it inside loop:
 +<code bash>
 +for tool in awk bc sed; do
 +    ....
 +done
 </code> </code>