Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [[ "$1" == "" ]]
- then
- printf "Directory in printOutput must be given\n"
- printf "Available dirs:\n"
- ls printOutput | sort
- exit
- fi
- if [ ! -d "printOutput/$1" ]; then
- printf "$1 does not exist.\n"
- exit
- fi
- files=$(find printOutput/$1 -maxdepth 2 -type f | sort )
- fileCnt=$(echo $files | wc -w)
- arr=($files)
- for((cnt=0; $cnt != $fileCnt; cnt++))
- do
- # echo ${arr[$cnt]}
- lpr -o sides=two-sided-long-edge ${arr[$cnt]}
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement