Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.45 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [[ "$1" == "" ]]
  4. then
  5.     printf "Directory in printOutput must be given\n"
  6.     printf "Available dirs:\n"
  7.     ls printOutput | sort
  8.     exit
  9. fi
  10. if [ ! -d "printOutput/$1" ]; then
  11.     printf "$1 does not exist.\n"
  12.     exit
  13. fi
  14. files=$(find printOutput/$1 -maxdepth 2 -type f | sort )
  15. fileCnt=$(echo $files | wc -w)
  16. arr=($files)
  17. for((cnt=0; $cnt != $fileCnt; cnt++))
  18. do
  19.     # echo ${arr[$cnt]}
  20.     lpr -o sides=two-sided-long-edge ${arr[$cnt]}
  21. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement