mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-20 07:07:51 +00:00
-v operator was added in bash 4.2 while we target bash 3
This commit is contained in:
parent
8e548e766e
commit
4085bc461e
8
main.sh
8
main.sh
@ -404,18 +404,16 @@ info "arg_f: ${arg_f}"
|
|||||||
info "arg_d: ${arg_d}"
|
info "arg_d: ${arg_d}"
|
||||||
info "arg_v: ${arg_v}"
|
info "arg_v: ${arg_v}"
|
||||||
info "arg_h: ${arg_h}"
|
info "arg_h: ${arg_h}"
|
||||||
if [[ -v arg_i ]]
|
if [[ -n "${arg_i:-}" ]]; then
|
||||||
then
|
|
||||||
info "arg_i: ${#arg_i[@]}"
|
info "arg_i: ${#arg_i[@]}"
|
||||||
for input_file in "${arg_i[@]}"
|
for input_file in "${arg_i[@]}"; do
|
||||||
do
|
|
||||||
info " - ${input_file}"
|
info " - ${input_file}"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
info "arg_i: 0"
|
info "arg_i: 0"
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=SC2015
|
# shellcheck disable=SC2015
|
||||||
[[ -v arg_x ]] && info "arg_x: ${#arg_x[@]}" || info "arg_x: 0"
|
[[ -n "${arg_x:-}" ]] && info "arg_x: ${#arg_x[@]}" || info "arg_x: 0"
|
||||||
|
|
||||||
info "$(echo -e "multiple lines example - line #1\\nmultiple lines example - line #2\\nimagine logging the output of 'ls -al /path/'")"
|
info "$(echo -e "multiple lines example - line #1\\nmultiple lines example - line #2\\nimagine logging the output of 'ls -al /path/'")"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user