shift
local arg
- for arg in $@; do
+ for arg in "$@"; do
list_append_one "${list}" "${arg}"
done
}
local ret=${EXIT_ERROR}
local arg
- for arg in $@; do
+ for arg in "$@"; do
if ! list_match ${arg} ${!list}; then
list_append_one ${list} "${arg}"
ret=${EXIT_OK}
local _list k
for k in ${!list}; do
- if list_match ${k} $@; then
+ if list_match ${k} "$@"; then
ret=${EXIT_OK}
continue
fi
list_sort() {
local i
- for i in $@; do
+ for i in "$@"; do
print "${i}"
done | sort | tr '\n' ' '
print
list_unique() {
local items item
- for item in $@; do
+ for item in "$@"; do
# Check if the item has already been processed.
list_match "${item}" ${items} && continue
shift
local i
- for i in $@; do
+ for i in "$@"; do
[ "${match}" = "${i}" ] && return ${EXIT_OK}
done
local length=0
local i
- for i in $@; do
+ for i in "$@"; do
length=$(( ${length} + 1 ))
done
local counter=0
local arg
- for arg in $@; do
+ for arg in "$@"; do
if [ "${arg}" = "${what}" ]; then
counter=$(( ${counter} + 1 ))
fi
list_reverse() {
local reversed arg
- for arg in $@; do
+ for arg in "$@"; do
reversed="${arg} ${reversed}"
done
list_head() {
local arg
- for arg in $@; do
+ for arg in "$@"; do
print "${arg}"
return ${EXIT_OK}
done