So I want to mount a usb device using a script if it's plugged in at boot. The usb device is not plugged in at every boot but others may be so I need to check if the label is correct and then mount it. So far I have the following line:
lsblk -rnpo label,name | awk '$1=="USB_FOO"{mount $2 /path/to/mount}'
but executing it gives me the following error:
awk: cmd. line:1: (FILENAME=- FNR=6) fatal: division by zero attempted
What would be a working example?