2

I am trying to replace the UUID in /etc/fstab using sed and I want to assume I don't know the current UUID.

Here's what I have tried so far:

 export UUID=$(blkid /dev/vda1 -sUUID -ovalue)
echo $UUID
f13d84b4-c756-4d89-9d5e-6b534397aa14
sudo sed -i -e "s/UUID=[a-f0-9-]+/UUID=$UUID/g" /etc/fstab

I think that should work, however the fstab doesn't seem to change at all. Would anyone be able to help or see where I am going wrong?

0 Answers0