Added 10 more gists.

This commit is contained in:
Miguel Astor
2023-06-19 09:38:01 -04:00
parent 8af706e97d
commit 1400a87eab
25 changed files with 1133 additions and 0 deletions

View File

@@ -0,0 +1 @@
Bash script that prints all JPEG and PNG images inside the working directory.

View File

@@ -0,0 +1,19 @@
#! /bin/bash
FILES=`ls -1 *.[jp]*`
ORIENTATION=" "
for f in $FILES
do
WIDTH=`identify $f | cut -d' ' -f3 | cut -d'x' -f1`
HEIGHT=`identify $f | cut -d' ' -f3 | cut -d'x' -f2`
if [ $WIDTH -lt $HEIGHT ]
then
ORIENTATION="portrait"
else
ORIENTATION="landscape"
fi
echo "Printing $f"
echo
lpr -o $ORIENTATION -o scaling=100 -o media=letter -o color=grayscale -o PrintQuality=photo $f
done