for i in $(
ldconfig -pN 2>/dev/null | while read a b c d; do
[[ "$c" != "=>" ]] && continue
- echo ${d%/*};
+ printf "%s\n" ${d%/*};
done
); do
a["$i"]=1;
shopt -q -s extglob
set -- "${1//+(\/)//}"
shopt -q -u extglob
- echo "${1%/}"
+ printf "%s\n" "${1%/}"
}
# convert_abs_rel <from> <to>
set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
# corner case #1 - self looping link
- [[ "$1" == "$2" ]] && { echo "${1##*/}"; return; }
+ [[ "$1" == "$2" ]] && { printf "%s\n" "${1##*/}"; return; }
# corner case #2 - own dir link
- [[ "${1%/*}" == "$2" ]] && { echo "."; return; }
+ [[ "${1%/*}" == "$2" ]] && { printf ".\n"; return; }
IFS="/" __current=($1)
IFS="/" __absolute=($2)
__newpath=$__newpath${__absolute[__i]}
done
- echo "$__newpath"
+ printf "%s\n" "$__newpath"
}
if [[ "$(ln --help)" == *--relative* ]]; then
_majmin=$(get_maj_min $_dev)
fi
if [[ $_majmin ]]; then
- echo $_majmin
+ printf "%s\n" "$_majmin"
else
- echo $_dev
+ printf "%s\n" "$_dev"
fi
return 0
fi
if [[ $_dev = *:* ]]; then
- echo $_dev
+ printf "%s\n" "$_dev"
return 0
fi
done; return 1; } && return 0
if [[ -b $_dev ]]; then
[[ $_majmin ]] || _majmin=$(get_maj_min $_dev)
if [[ $_majmin ]]; then
- echo $_majmin
+ printf "%s\n" "$_majmin"
else
- echo $_dev
+ printf "%s\n" "$_dev"
fi
return 0
fi
if [[ $_dev = *:* ]]; then
- echo $_dev
+ printf "%s\n" "$_dev"
return 0
fi
done; return 1; } && return 0
while read _fs; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
- echo -n $_fs
+ printf "%s" "$_fs"
return 0
done; return 1; } && return 0
fi
while read _fs; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
- echo -n $_fs
+ printf "%s" "$_fs"
return 0
done; return 1; } && return 0
while read _fs; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
- echo -n $_fs
+ printf "%s" "$_fs"
return 0
done; return 1; } && return 0
fi
while read _fs; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
- echo -n $_fs
+ printf "%s" "$_fs"
return 0
done; return 1; } && return 0
host_fs_all()
{
- echo "${host_fs_types[@]}"
+ printf "%s\n" "${host_fs_types[@]}"
}
# Walk all the slave relationships for a given block device.
if [[ $_lv = $2 ]]; then
_vg=$(lvm lvs --noheadings -o vg_name $i 2>/dev/null)
# strip space
- _vg=$(echo $_vg)
+ _vg=$(printf "%s\n" "$_vg")
if [[ $_vg ]]; then
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
do