Skip to content

Commit

Permalink
wrap ${args[@]} with quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderOrb committed Jul 29, 2024
1 parent 4821744 commit b4f10af
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 98 deletions.
60 changes: 30 additions & 30 deletions Source/GUI/dvrescue/dvrescue/windows-tools/scripts/dvrescue.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# store arguments in a special array
args=("$@")
# get number of elements
ELEMENTS=${#args[@]}

# echo each element in array
# for loop

for (( i=0;i<$ELEMENTS;i++)); do
# echo "${args[${i}]}"
if [[ ${args[${i}]} == /cygdrive* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi
if [[ ${args[${i}]} == /tmp* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi

args[${i}]="${args[${i}]}"
done

echo ${args[@]} > dvrescue.args
dvrescue ${args[@]}

#set "${args[@]}"

#echo $@ > dvrescue.args
# store arguments in a special array
args=("$@")
# get number of elements
ELEMENTS=${#args[@]}

# echo each element in array
# for loop

for (( i=0;i<$ELEMENTS;i++)); do
# echo "${args[${i}]}"
if [[ ${args[${i}]} == /cygdrive* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi
if [[ ${args[${i}]} == /tmp* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi

args[${i}]="${args[${i}]}"
done

echo ${args[@]} > dvrescue.args
dvrescue "${args[@]}"

#set "${args[@]}"

#echo $@ > dvrescue.args
#dvrescue $@
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for (( i=0;i<$ELEMENTS;i++)); do
done

echo ${args[@]} > ffmpeg.args
ffmpeg ${args[@]}
ffmpeg "${args[@]}"

#set "${args[@]}"

Expand Down
66 changes: 33 additions & 33 deletions Source/GUI/dvrescue/dvrescue/windows-tools/scripts/mediainfo.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# store arguments in a special array
args=("$@")

echo $@ > mediainfo.args.orig

# get number of elements
ELEMENTS=${#args[@]}

# echo each element in array
# for loop

for (( i=0;i<$ELEMENTS;i++)); do
# echo "${args[${i}]}"
if [[ ${args[${i}]} == /cygdrive* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi
if [[ ${args[${i}]} == /tmp* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi

args[${i}]="${args[${i}]}"
done

echo ${args[@]} > mediainfo.args
mediainfo ${args[@]}

#set "${args[@]}"

#echo $@ > mediainfo.args
# store arguments in a special array
args=("$@")

echo $@ > mediainfo.args.orig

# get number of elements
ELEMENTS=${#args[@]}

# echo each element in array
# for loop

for (( i=0;i<$ELEMENTS;i++)); do
# echo "${args[${i}]}"
if [[ ${args[${i}]} == /cygdrive* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi
if [[ ${args[${i}]} == /tmp* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi

args[${i}]="${args[${i}]}"
done

echo ${args[@]} > mediainfo.args
mediainfo "${args[@]}"

#set "${args[@]}"

#echo $@ > mediainfo.args
#mediainfo $@
68 changes: 34 additions & 34 deletions Source/GUI/dvrescue/dvrescue/windows-tools/scripts/xml.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# store arguments in a special array
args=("$@")
# get number of elements
ELEMENTS=${#args[@]}

# echo "$@" > args.txt

# echo each element in array
# for loop

for (( i=0;i<$ELEMENTS;i++)); do
# echo "${args[${i}]}"
if [[ ${args[${i}]} == /cygdrive* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi
if [[ ${args[${i}]} == /tmp* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi

args[${i}]="${args[${i}]}"
done

echo ${args[@]} > xml.args
xml ${args[@]}

# set "${args[@]}"

# echo $@ > xml.args

# OUTPUT=$(xml $@)
# store arguments in a special array
args=("$@")
# get number of elements
ELEMENTS=${#args[@]}

# echo "$@" > args.txt

# echo each element in array
# for loop

for (( i=0;i<$ELEMENTS;i++)); do
# echo "${args[${i}]}"
if [[ ${args[${i}]} == /cygdrive* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi
if [[ ${args[${i}]} == /tmp* ]]; then
path=$(cygpath -w ${args[${i}]})
# echo "original path: ${args[${i}]}, updated path: $path"
args[${i}]=$path
fi

args[${i}]="${args[${i}]}"
done

echo ${args[@]} > xml.args
xml "${args[@]}"

# set "${args[@]}"

# echo $@ > xml.args

# OUTPUT=$(xml $@)
# echo $OUTPUT

0 comments on commit b4f10af

Please sign in to comment.