O'Reilly logo
  • Jan Spengler thinks this is interesting:

FFILE=/etc/fstab; cp -pRf $FFILE $FFILE-`date'+%m%d%Y'` && sed -e 's/^UUID.* \/ .*errors=remount-ro/&,user_xattr,acl,barrier=1/' $FFILE > $FFILE-new && mv $FFILE-new$FFILE && echo "$FFILE edited OK."

From

Cover of Implementing Samba 4

Note

Missing spaces in date and mv:
FFILE=/etc/fstab; cp -pRf $FFILE $FFILE-date '+%m%d%Y' && sed -e 's/^UUID. \/ .errors=remount-ro/&,user_xattr,acl,barrier=1/' $FFILE > $FFILE-new && mv $FFILE-new $FFILE && echo "$FFILE edited OK."