diff --git a/bash-test.sh b/bash-test.sh index 7a26f48..1197151 100755 --- a/bash-test.sh +++ b/bash-test.sh @@ -1,19 +1,15 @@ #!/usr/bin/env bash -# NOTE: this is way simpler -echo $(realpath "${BASH_SOURCE}") +vector=({1..20}) -# NOTE: this is useless -if [[ "${0}" == "${BASH_SOURCE}" ]]; then - root_dir="$(dirname "${0}")" - root_dir="$(realpath "${root_dir}")" -else - root_dir="$(dirname "${0}")/$(dirname "${BASH_SOURCE}")" - root_dir="$(realpath "${root_dir}")" -fi +echo "before : ${vector[@]}" -tput smso -echo ${root_dir} -tput rmso +for n in ${!vector[@]}; do + echo $n + if (($n % 2 == 0)); then + unset vector[$n] + fi +done -echo "blargh" +echo "after : ${vector[@]}" +echo "after_index : ${!vector[@]}"