Closed groengpx closed 1 year ago
Due to how the bus / hardware works, the driver is unloaded every time the system suspends. An error during unloading can result in the hidraw device staying around as a ghost device with no driver backing it. So when you resume, you get two hidraw devices called "IPTS", and you want the one that was created last.
Whoops, my bad. I confused it with tail -c +1
, which would output lines from the beginning,
which would not be very useful in a pipe, unless there was some shell trick I was unaware of.
Of course, tail -n1
lists only the last line, which is not a trick, but just regular use.
Well, at least I learned why we only need the last line from $DEVICES
.
Thanks for the explanation.
Out of sheer curiosity, why is
$DEVICES
piped throughtail -n1
before being piped togrep
?tail -n1
seems a no-op to me. Am I missing something?https://github.com/linux-surface/iptsd/blob/c7c484477206b4a49c0caf76b94ccdfc9311ba76/etc/iptsd-find-hidraw#L4