Use sh-supported argument shift for portability

This commit is contained in:
the-sane 2020-08-04 18:07:50 -04:00 committed by GitHub
parent 617313ff05
commit 5b9d5056e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env sh
############################################################################ ############################################################################
# Star Citizen's Linux Users Group Helper Script # Star Citizen's Linux Users Group Helper Script
@ -65,10 +65,12 @@ message() {
# Display the message # Display the message
if [ "$1" -eq 4 ] || [ "$1" -eq 5 ]; then if [ "$1" -eq 4 ] || [ "$1" -eq 5 ]; then
# requires a space between the assembled arguments # requires a space between the assembled arguments
zenity "${margs[@]}" "${@:2}" --width="400" --title="Star Citizen LUG Helper Script" shift 1 # drop the first numerical argument and shift the remaining up one
zenity "${margs[@]}" "$@" --width="400" --title="Star Citizen LUG Helper Script"
else else
# no space between the assmebled arguments # no space between the assmebled arguments
zenity "${margs[@]}""${@:2}" --width="400" --title="Star Citizen LUG Helper Script" shift 1 # drop the first numerical argument and shift the remaining up one
zenity "${margs[@]}""$@" --width="400" --title="Star Citizen LUG Helper Script"
fi fi
else else
# Text based menu. Does not work with message types 4 and 5 (zenity radio lists) # Text based menu. Does not work with message types 4 and 5 (zenity radio lists)