Created
April 24, 2017 18:24
-
-
Save anonymous/e25a56851d37cf37537b2f5156538f51 to your computer and use it in GitHub Desktop.
print files of a directory
This file contains 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/sh | |
LPRCMD='lpr -o media=Custom.100x162mm' | |
#LPRCMD=echo | |
# onefile number filename | |
onefile() { | |
$LPRCMD -#$1 $2 | |
mv $2 printed | |
} | |
allfiles() { | |
echo . | |
files=`ls *.png` | |
sleep 1 | |
for file in $files | |
do | |
# if [ $file != '*_*_x?.png' ] | |
case $file in | |
*_*_x4.png ) onefile 4 $file ; ;; | |
*_*_x3.png ) onefile 3 $file ; ;; | |
*_*_x2.png ) onefile 2 $file ; ;; | |
*_*_x1.png ) onefile 1 $file ; ;; | |
esac | |
done | |
} | |
crazy() { | |
all=`echo *zoo` | |
for i in $all ; do echo $i ; done ; exit | |
} | |
# main | |
touch do-not-delete-this-empty-file.png | |
while [ 1 ] | |
do | |
allfiles | |
sleep 10 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment