Wrapped command path variables in double quotes

master
Thomas Schmitt 3 years ago
parent 02e55a9dbc
commit f7f484de20
  1. 22
      xorriso-dd-target/xorriso-dd-target

@ -230,7 +230,7 @@ arg_interpreter() {
elif test -n "$with_sudo"
then
echo "Testing sudo to possibly get password prompting done now:" >&2
if sudo $lsblk_cmd -h >/dev/null
if sudo "$lsblk_cmd" -h >/dev/null
then
echo "sudo $lsblk_cmd seems ok." >&2
echo >&2
@ -256,7 +256,7 @@ plug_in_watcher() {
echo "and then unplug it." >&2
echo "Press the Enter key when ready." >&2
read dummy
old_device_list=' '$($lsblk_cmd -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]' | tr '\n\r' ' ')' '
old_device_list=' '$("$lsblk_cmd" -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]' | tr '\n\r' ' ')' '
# <<< Mock-up to save USB socket wear-off by erasing items from old_device_list
# <<< Their presence in new_device_list will let them appear as fresh plugs
@ -271,7 +271,7 @@ plug_in_watcher() {
end_time="$(expr $(date +'%s') + 10)"
while test $(date +'%s') -le "$end_time"
do
new_device_list=' '$($lsblk_cmd -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]' | tr '\n\r' ' ')' '
new_device_list=' '$("$lsblk_cmd" -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]' | tr '\n\r' ' ')' '
if test "$old_device_list" = "$new_device_list"
then
sleep 1
@ -327,7 +327,7 @@ list_devices() {
if test -z "$devs"
then
# Obtain list of top-level names which do not look like CD or floppy.
devs=$($lsblk_cmd -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]')
devs=$("$lsblk_cmd" -d -n -o NAME | grep -v '^sr[0-9]' | grep -v '^fd[0-9]')
fi
not_advised=0
@ -368,7 +368,7 @@ list_devices() {
transports=not_an_expected_name
reasons="${reasons}name_with_slash- "
else
transports=$($lsblk_cmd -n -o TRAN /dev/"$name")
transports=$("$lsblk_cmd" -n -o TRAN /dev/"$name")
fi
if test -z "$transports"
then
@ -405,7 +405,7 @@ list_devices() {
fi
# Wanted or unwanted filesystem types
fstypes=$($sudo_cmd $lsblk_cmd -n -o FSTYPE /dev/"$name")
fstypes=$("$sudo_cmd" "$lsblk_cmd" -n -o FSTYPE /dev/"$name")
if test "$?" -gt 0
then
fstypes="lsblk_fstype_error"
@ -465,7 +465,7 @@ list_devices() {
# Optional tests for size
if test -n "$max_size" -o -n "$min_size"
then
size=$($lsblk_cmd -n -b -o SIZE /dev/"$name" | head -1 | round_down_div_million)
size=$("$lsblk_cmd" -n -b -o SIZE /dev/"$name" | head -1 | round_down_div_million)
if test -z "$size"
then
yucky=y
@ -493,7 +493,7 @@ list_devices() {
descr=
if test -n "$with_vendor_model"
then
descr=": "$($lsblk_cmd -n -o VENDOR,MODEL /dev/"$name" | tr '\n\r' ' ' | tr -s ' ')
descr=": "$("$lsblk_cmd" -n -o VENDOR,MODEL /dev/"$name" | tr '\n\r' ' ' | tr -s ' ')
fi
if test -n "$yucky"
then
@ -516,7 +516,7 @@ list_devices() {
## Puts list of mounted (sub-)devices of $1 into $mounted_devs
list_mounted_of() {
partitions=$($lsblk_cmd -n -p -o NAME /dev/"$1" | grep -v '^'/dev/"$1"'$' \
partitions=$("$lsblk_cmd" -n -p -o NAME /dev/"$1" | grep -v '^'/dev/"$1"'$' \
| sed -e 's/[^a-zA-Z0-9_+@:.,/-]//g' | tr '\n\r' ' ')
mounted_devs=
for i in /dev/"$1" $partitions
@ -559,7 +559,7 @@ write_image() {
then
echo " $sudo_cmd $umount_cmd $i"
else
if $sudo_cmd $umount_cmd "$i"
if "$sudo_cmd" "$umount_cmd" "$i"
then
echo "Unmounted: $i"
else
@ -592,7 +592,7 @@ write_image() {
else
echo "Performing:"
echo " $sudo_cmd $dd_cmd if='${1}' bs=1M of=/dev/'${2}' ; sync"
$sudo_cmd $dd_cmd if="${1}" bs=1M of=/dev/"${2}" ; sync
"$sudo_cmd" "$dd_cmd" if="${1}" bs=1M of=/dev/"${2}" ; sync
fi
# >>> ??? Erase possible GPT backup table at end of device ?

Loading…
Cancel
Save