$ wget "https://raw.githubusercontent.com/coderofsalvation/powscript/master/powscript" -O /usr/local/bin/powscript && chmod 755 /usr/local/bin/powscript
$ powscript myscript.pow # run directly
$ powscript --compile myscript.pow > myscript # output bashscript
#!/usr/bin/env powscript
usage(app)
echo "$app <number>"
switch $1
case [0-9]*
echo "arg 1 is a number"
case *
if empty $1
help=$(usage myapp)
echo "Usage: $help" && exit
Check the wiki here
- memorizable syntax: more human-like, less robotic { ! [[ @ ]] || ~ and so on
- safetynets: automatic quoting, halt on error
- comfort: easy arrays, functional programming, named variables instead of positionals
- written in bash 4, 'zero'-dependency solution
- hasslefree: no installation or compilation using 3rd party software
Create 1 portable bashscript.
require 'mod/mymod.pow'
require 'mod/foo.bash'
mymodfunc
bar
mymodfunc()
echo "hi im a powscript module!"
function bar(){
echo "hi im a bash module"
}
Then run powscript --compile myapp.pow > all-in-one.bash
on
first
last
filter
curry