Quote:
Originally Posted by ransur0t
I tried modifying your script for the ghost scanner (scanimage -L returns the culprit "device `hpaio:/net/Deskjet_3050_J610_series?zc=hp-printer' is a Hewlett-Packard Deskjet_3050_J610_series all-in-one"), using the string <Deskjet_3050_J610>, but the terminal does not return anything after executing the script.
I saved it as .sh file, and chmod +x. Am I doing something wrong?
|
I think you did it right. You can copy-paste the script in the console, or save it to an sh file and run it later. In this case, better start the file with the "#!/bin/bash" line (without the quotes).
About why it didn't return any result for you, I would try to look for simpler words in lowercase ("grep -i" is case insensitive) and avoid special characters (like underscore "_"). For instance, change the first line of the script to any of these ones:
grep -i "deskjet" $(
grep -i "3050" $(
grep -i "j610" $(
If that doesn't return any result, you still can try to have a look to the whole (large!) list of files opened by scanimage and see if any of them draws your attention:
Code:
for i in $(strace -f scanimage -L 2>&1 | grep 'open(' | sed 's/^[^"]*"//' | sed 's/"[^"]*$//')
do
if [ -f $i ]
then
echo $i
fi
done
Good luck.