You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ptrcnull 55b9261cfd feat: add elevate, where, iscmd 4 months ago
LICENSE feat: initial commit 4 months ago
README.md feat: add elevate, where, iscmd 4 months ago
elevate feat: add elevate, where, iscmd 4 months ago
eprintln feat: initial commit 4 months ago
iscmd feat: add elevate, where, iscmd 4 months ago
println feat: initial commit 4 months ago
tdefine feat: initial commit 4 months ago
where feat: add elevate, where, iscmd 4 months ago

README.md

execline-ptrc-extras

fun execline scripts to try at home

println

like echo, but chainable

println "test"
echo test1

eprintln

println but to stderr :)

eprintln "test"
echo test1

tdefine

ternary define: $1 = if ($4) { $2 } { $3 } cmd...

backtick -E uid { id -u }
tdefine sucmd "doas" "exec" { s6-test $uid != 0 }

$sucmd s6-linux-init-shutdown

elevate

the same thing from above but just one command (and with sudo fallback)

elevate s6-linux-init-shutdown

where

which(1) but in execline

backtick -E sh { where sh }
echo "shell full path: $sh"

iscmd

exits with 0 if command exists

tdefine shell "zsh" "sh" { iscmd zsh }