grub-btrfs icon indicating copy to clipboard operation
grub-btrfs copied to clipboard

please do not use bash

Open bastien-roucaries opened this issue 2 years ago • 2 comments

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 avatar Sep 27 '23 11:09 bastien-roucaries

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[@]}"

bastien-roucaries avatar Sep 27 '23 11:09 bastien-roucaries

I will look into this, but honestly I think the script is full of this and using sh is very inconvienient here.

Schievel1 avatar Sep 30 '23 08:09 Schievel1