# Output: stdout (newline delimited)
# Example: read_stdin_psarg "$@"
# Depends: GNU bash (version 5.1.16)
- # Version: 0.0.1
+ # Version: 0.0.3
local input_stdin input_psarg output;
# Store stdin
if [[ -p /dev/stdin ]]; then
input_stdin="$(cat -)";
fi;
- yell "DEBUG:$(declare -p input_stdin)";
# Store arguments
if [[ $# -gt 0 ]]; then
- input_psarg="$@";
+ input_psarg="$*";
fi;
- yell "DEBUG:$(declare -p input_psarg)";
# Combine as output array elements
## Read in stdin
output+=("$arg");
done;
fi;
- yell "DEBUG:$(declare -p output)";
# Print to stdout
printf "%s\n" "${output[@]}";