This framework is currently a couple of tools written to help manage scripts and functions in dash/bash on a GNU/Linux (Debian/Ubuntu) system.
This is not really designed for "installation" yet. It's only really three scripts so they can simple be copied into the relevant directories or symlinked into the relevant directories; both methods work.
ssf
currently has two commands: fun
and new
, they aren't
particularly consistent at the moment but I'll fix that.
fun
fetches the function definition from the specified filename. It's a wrapper forprint_function
described below.new
creates a new script in the~/.scripts
folder (default). It is a wrapper fornew_script
described below.
Creates a Bash script named after the argument.
- Checks that the script doesn't already exist, exits if so.
- Creates the script in the same folder as
new_script
- Makes the script executable by the user
- Opens the script pre-populated with a hashbang ready for editing.
- The
EDITOR
environment variable must be set.
Prints the contents of a function to STDOUT.
- Checks the specified function exists in
$FUNCPATH
- Uses
cat
andsed
to print the function toSTDOUT
with an "infoline".
- The
FUNCPATH
environment variable must be set.
- Retains blank lines