33 lines
400 B
Markdown
33 lines
400 B
Markdown
|
# execline-ptrc-extras
|
||
|
|
||
|
> fun execline scripts to try at home
|
||
|
|
||
|
### println
|
||
|
|
||
|
like echo, but chainable
|
||
|
|
||
|
```sh
|
||
|
println "test"
|
||
|
echo test1
|
||
|
```
|
||
|
|
||
|
### eprintln
|
||
|
|
||
|
println but to stderr :)
|
||
|
|
||
|
```sh
|
||
|
eprintln "test"
|
||
|
echo test1
|
||
|
```
|
||
|
|
||
|
### tdefine
|
||
|
|
||
|
ternary define: `$1 = if ($4) { $2 } { $3 } cmd...`
|
||
|
|
||
|
```sh
|
||
|
backtick -E uid { id -u }
|
||
|
tdefine sucmd "doas" "exec" { s6-test $uid != 0 }
|
||
|
|
||
|
$sucmd s6-linux-init-shutdown
|
||
|
```
|