# blkid --uuid 2026-01-19-03-28-45-00
/dev/sdc
Meaning that the block device with that UUID is connected to the system.
When this executes,
destination="2026-01-19-03-28-45-00";
printf "destination=$destination\n";
if ! ( lsblk -alno UUID | grep $destination > /dev/null ); then
printf "destination device not connected. Aborting.\n"
else
printf "destination device is connected.\n"
dev="$( blkid --uuid $destination )";
printf "dev=$dev\n";
# FTH;
fi;
this is the output.
destination=2026-01-19-03-28-45-00
destination device not connected. Aborting.
With the device being present, I expect this.
destination=2026-01-19-03-28-45-00
destination device is connected.
dev=/dev/sdc
Does this line have a syntax error?
if ! ( lsblk -alno UUID | grep $destination > /dev/null ); then
Thanks, ... P.
--
mobile: +1 778 951 5147
VoIP: +1 778 508 0020
Bcc: peter at e a s t h o p e dot c a
projects: en.wikibooks.org/wiki/User:PeterEasthope