usbmount icon indicating copy to clipboard operation
usbmount copied to clipboard

UUID matching in /etc/fstab doesn't work

Open ColinTaylorUK opened this issue 7 years ago • 0 comments

https://github.com/rbrito/usbmount/blob/9a92e7d622662380f4329e0db17e263509715722/usbmount#L109

This change breaks UUID matching in /etc/fstab on Ubuntu 18.04.1 (and probably most other OS).

The problem is that it tries to match using "? but ? is not a basic regular expression (BRE) metacharacter. ? is an extended regular expression (ERE) metacharacter so grep needs the "-E" parameter as follows:

elif egrep -q "^[[:blank:]]*UUID=\"?$UUID\"?" /etc/fstab; then

It will now work.

EDIT: Changed "grep -E" to "egrep" to be consistent with the rest of the code.

ColinTaylorUK avatar Oct 20 '18 18:10 ColinTaylorUK