On 1/25/26 5:12 AM, [email protected] wrote:
# 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,
Please put the script as an attachment.
destination="2026-01-19-03-28-45-00";
printf "destination=$destination\n";
Assuming that $dest should be a string `printf "dest=%s\n" $dest`.
If your code is in a function, please put that func as well.
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;
You don't need to end your lines with a ';'.
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
It's always better to also explain in plain English what you have
working and what is not and what you are expecting.
Does this line have a syntax error?
if ! ( lsblk -alno UUID | grep $destination > /dev/null ); then
Your shell interpreter would tell you that.
Likely not the answer you are looking for but asking for help takes time.
--
John Doe