#! /usr/bin/env sh devices="" check_devices() { devices_tmp=$(ls /dev | grep -E '^sd[a-z]$') if [ "${devices}" != "${devices_tmp}" ] then devices="${devices_tmp}" echo "${devices}" echo -n "Enter device to dump: " read device if [ "${device}" != "" ] then ./dd_prololive.sh "${device}" else echo "Doing nothing" fi fi } while :; do check_devices sleep 0.1 done