Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrap ${args[@]} with quotes #920

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading