please do not use bash
bastien-roucaries opened this issue · comments
bastien-roucaries commented
Hi,
A really low priority task, but you should try to only use dash (/bin/sh) construct.
It will allow to create smaller virtual machine on debian side
Bastien
bastien-roucaries commented
checkbashism seems to support this a low effort goal
possible bashism in /tmp/grub-btrfs line 16 ($'...' should be "$(printf '...')"):
GREEN=$'\033[0;32m'
possible bashism in /tmp/grub-btrfs line 17 ($'...' should be "$(printf '...')"):
RED=$'\033[0;31m'
possible bashism in /tmp/grub-btrfs line 18 ($'...' should be "$(printf '...')"):
CYAN=$'\033[;36m'
possible bashism in /tmp/grub-btrfs line 19 ($'...' should be "$(printf '...')"):
RESET=$'\033[0m'
possible bashism in /tmp/grub-btrfs line 22 ($'...' should be "$(printf '...')"):
GREEN=$'\033[0;0m'
possible bashism in /tmp/grub-btrfs line 23 ($'...' should be "$(printf '...')"):
RED=$'\033[0;0m'
possible bashism in /tmp/grub-btrfs line 24 ($'...' should be "$(printf '...')"):
CYAN=$'\033[;0m'
possible bashism in /tmp/grub-btrfs line 25 ($'...' should be "$(printf '...')"):
RESET=$'\033[0m'
possible bashism in /tmp/grub-btrfs line 89 (${!name}):
logfile="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
possible bashism in /tmp/grub-btrfs line 111 (${foo:3[:1]}):
if [ "$OPTERR" = 1 ] && [ "${optspec:0:1}" != ":" ]; then
possible bashism in /tmp/grub-btrfs line 145 (${foo:3[:1]}):
if [ "$OPTERR" = 1 ] || [ "${optspec:0:1}" = ":" ]; then
possible bashism in /tmp/grub-btrfs line 169 (bash arrays, ${name[0|*|@]}):
for snapdir in "${snapdirs[@]}"
possible bashism in /tmp/grub-btrfs line 315 (bash arrays, ${name[0|*|@]}):
vlog "Snapshot directories: ${snapdirs[*]}"
possible bashism in /tmp/grub-btrfs line 330 (bash arrays, ${name[0|*|@]}):
for snapdir in "${snapdirs[@]}"
Pascal J commented
I will look into this, but honestly I think the script is full of this and using sh is very inconvienient here.