usr_sbin/grml-config-root: Fix a couple of shellcheck warnings
authorDarshaka Pathirana <dpat@syn-net.org>
Fri, 5 Mar 2021 15:07:46 +0000 (16:07 +0100)
committerDarshaka Pathirana <dpat@syn-net.org>
Fri, 3 Dec 2021 11:54:54 +0000 (12:54 +0100)
- SC2006: Use $(..) instead of legacy `..`.
- SC2230: which is non-standard. Use builtin 'command -v' instead.
- SC2086: Double quote to prevent globbing and word splitting.

usr_sbin/grml-config-root

index e1e1158..db6a2a5 100755 (executable)
@@ -9,8 +9,8 @@
 PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
 
 # set up some variables
 PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'}
 
 # set up some variables
-DIALOG=`which dialog`
-PN=$(basename $0)
+DIALOG=$(command -v dialog)
+PN=$(basename "$0")
 
 if [ "$(id -ru)" != "0" ] ; then
         $DIALOG --msgbox "Error: $0 requires root permissions. Exiting." 0 0
 
 if [ "$(id -ru)" != "0" ] ; then
         $DIALOG --msgbox "Error: $0 requires root permissions. Exiting." 0 0