part of shnell – a source to source compiler enhancement tool
© Jens Gustedt, 2017-2019
Split and join words and word lists
We use different sh
features for primitive word processing
Coding and configuration
The following code is needed to enable the sh-module framework.
SRC="$_" . "${0%%/${0##*/}}/import.sh"
Declared functions
slines
: Print all words on a separate line
splitter
: Print all words separated by spaces
join
: Join the arguments in list $2 $3 … by the string in $1 and store into variable named joinRet
joinEcho
: Echo the join of the argment list
split
: Split the arguments starting at $2 according to the character in $1.
sj
: Split the arguments starting at $3 according to the character in $1, and rejoin them together with the string in $2.