Create variables.inc.sh

This commit is contained in:
tcely
2025-03-27 10:15:25 -04:00
committed by GitHub
parent e4eb895b09
commit 5757455b46

10
.github/sh/library/variables.inc.sh vendored Normal file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env sh
# For setting single line variables in the environment or output
set_sl_var() { local f='%s=%s\n' ; printf -- "${f}" "$@" ; } ;
# Used together to set multiple line variables in the environment or output
mk_delim() { printf -- '"%s_EOF_%d_"' "$1" "${RANDOM}" ; } ;
open_ml_var() { local f=''\%'s<<'\%'s\n' ; printf -- "${f}" "$2" "$1" ; } ;
close_ml_var() { local f='%s\n' ; printf -- "${f}" "$1" ; } ;