Skip to content

Instantly share code, notes, and snippets.

@t0d0r
Created June 16, 2011 12:50
Show Gist options
  • Save t0d0r/1029169 to your computer and use it in GitHub Desktop.
Save t0d0r/1029169 to your computer and use it in GitHub Desktop.
my script to use scanner in office
#!/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
#!/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