Created
June 16, 2011 12:50
-
-
Save t0d0r/1029169 to your computer and use it in GitHub Desktop.
my script to use scanner in office
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| date=`date +"%Y%m%d%H%M%S"` | |
| pwd=`pwd` | |
| pwd=~/Desktop | |
| filename="${pwd}/scanned_${date}.tif" | |
| echo "Finding device..." | |
| device=$(scanimage -L | cut -d ' ' -f 2 | sed -e "s/[\`\|\']//g") | |
| echo "got ${device}" | |
| if [ ! -f "${filename}" ]; then | |
| # scanimage --format=tiff --mode lineart --resolution=75 -d "net:192.168.1.254:snapscan:libusb:003:002" -p > ${filename} | |
| scanimage --format=tiff --resolution=300 -d "${device}" -p > ${filename} | |
| echo ${filename} | |
| open ${filename} | |
| else | |
| echo "$1 already exist !" | |
| exit 2 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| date=`date +"%Y%m%d%H%M%S"` | |
| pwd=`pwd` | |
| pwd=~/Desktop | |
| filename="${pwd}/scanned_${date}.tif" | |
| echo "Finding device..." | |
| device=$(scanimage -L | cut -d ' ' -f 2 | sed -e "s/[\`\|\']//g") | |
| echo "got ${device}" | |
| if [ ! -f "${filename}" ]; then | |
| # scanimage --format=tiff --mode lineart --resolution=75 -d "net:192.168.1.254:snapscan:libusb:003:002" -p > ${filename} | |
| scanimage --format=tiff --resolution=300 -d "${device}" -p > ${filename} | |
| echo ${filename} | |
| open ${filename} | |
| else | |
| echo "$1 already exist !" | |
| exit 2 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment