"$@" will expand to "$1" "$2"...
If there are no positional parameters, "$@" expands to nothing.
So, you are running that with args? Need some info.
I ran that. Doesn't do anything except echo the dirs that you enter as args.
test.sh
Code:
#!/usr/bin/bash
declare -A tag
for dpa in "$@"; do
[[ ! -d $dpa ]] && continue
[[ ${tag[comint:$dpa]} ]] && continue
fdir+=("$dpa")
tag[comint:$dpa]=1
done
echo "${fdir[@]}"
echo "${tag[@]}"
You want to tell what you are trying to achieve, or just ignore the forum and keep on going?