@tost tosti tosti tosti i achieved to make mine shorter and beat yours for 18 characters ????
mine:
#!/bin/sh check_distro() { distro=$(sed -n 's/^\(ID\|ID_LIKE\)= *\([^ ]*\) */\2/p' /etc/os-release) case $distro in debian) : # do debian-based thing ;; fedora) : # do fedora-based thing ;; *) : # err distro not supported ;; esac } check_distroyours:
#!/bin/sh check_distro() { for distro in debian fedora error do grep -qe $distro /etc/os-release && break done case $distro in debian) : # do debian-based thing ;; fedora) : # do fedora-based thing ;; *) : # err distro not supported ;; esac } check_distro