Shashank Bhat
Shashank Bhat

Reputation: 101

lpr command not working with CYGWIN.

#!/bin/bash
while :
do
if [ -e ./*.pdf ]
    then
        #printer=$(lpstat -p | grep printer | head -n1 | cut -d \  -f 2)
        printer=$(cat printer.ini)
        for file in *.pdf
        do
         echo "Printing $file"
         $(lpr -P $printer $file)
         echo "Moving $file"
         $(mv $file ./p)
        done
    fi
done

when I'm trying to run this script in windows using CYGWIN it is showing..lpr is not a internal or external command..Please give me a solution for this.

Upvotes: 1

Views: 1850

Answers (1)

苦しみ 甘い
苦しみ 甘い

Reputation: 119

Cygwin has modules (packages). A limited amount of them are installed by default, you need to choose the ones you need by running the setup again and selecting them. lpr is in cygutils, iirc. Also, you seem to be running this in a windows command prompt instead of sh or mintty, etc. (error is specific to cmd.exe afaik).

Upvotes: 1

Related Questions