I'm making a autoscan-script with scanimage and want to set up an "autofind-device", but I don't know how to replace ` or '
This is the scanimage command for listing supported devices:
scanimage -L
and the output is:
Code:
device `hpaio:/usb/HP_LaserJet_3052?serial=00CNSKN09261' is a Hewlett-Packard HP_LaserJet_3052 all-in-one
I would like to to something like:
scanimage -L | sed 's/device \`/\n/' | sed s/\'/\n/' | awk 'NR==2'
or
scanimage -L | awk '/\`/,/\'/'
So that the output is:
hpaio:/usb/HP_LaserJet_3052?serial=00CNSKN09261
But I can't get sed (or awk) to remove/read the ` or the '
How can I do this?
@ngelot