The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM



Thread: Unix Script
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-09-2008
simshark simshark is offline
Registered User
 

Join Date: Apr 2008
Posts: 4
Quote:
Originally Posted by era View Post
If your find is capable enough, it will be able to give you minute granularity. If not, maybe we can develop something here.

If all the entries in /var/spool/lp/requests are the names of printers you want to connect to, and there are none there which you don't want to connect to, just loop over those then?

The wc -l is Useless

Code:
for PRINTER in /var/spool/lp/request/*
do
  if find "$PRINTER" -mmin +60 | grep "$LOCAL_SERVER" >/dev/null
  then
    echo `basename "$PRINTER"` >> /cia/ciaadm/bin/printer.list
    /usr/local/bin/canprint `basename "$PRINTER"`
    let cnt=cnt+1
  fi
done
era, thanks.

but mmin does not work in my version of hp-ux...im getting a "find bad option - mmin"

I do not want to complicate things by using touch

Is there any other way to break this down?

Thanks!
Reply With Quote