Explorar o código

more elegant execname

UltimateByte %!s(int64=9) %!d(string=hai) anos
pai
achega
745254777a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lgsm/functions/check_permissions.sh

+ 1 - 1
lgsm/functions/check_permissions.sh

@@ -83,7 +83,7 @@ fn_check_permissions(){
 	fi
 	# Check if executable is executable and attempt to fix it
 	# First get executable name
-	execname="$(echo "${executable}" | awk -F "/" '{ print $2 }')"
+	execname="$(basename "${executable}"
 	if [ -f "${executabledir}/${execname}" ]; then
 		# Get permission numbers on file under the form 775
 		execperm="$(stat -c %a "${executabledir}/${execname}")"