Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print & clear directory files after

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi,

i have to clean up the directory right after printing.

how i am gonna do it? i appreciate any response.

thanks.
 
Hi dmytri,

Should be possible -- a shell script that first prints a file and then deletes it.

You might want to separate these two steps so that you can verify files hace printed correctly before you delete them.

Tell us a bit more about what you'd like to do, your environment etc. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
thank you.

i'm using HP-UX 10.20 and currently have to deal with the prob asap.

based from your response, i should say - i have to look for the initial printing script file first, i should include remove file or validate before delete.

do you have validating argument or line/s maybe in the script before deletion? to make sure i don't del files if they're not printed.

thank you in advance.
 
dmytri,

When lp prints a file normally it prints the *actual* file, so if you do something like:

lp file.txt && rm file.txt

(which translates as "if the lp command returns ok remove the file)

It's quite likely to fail as rm could easily delete the file before lp gets around to printing it.

I remember that there's an lp option (-c I think) that gets around this by taking a copy of the file and printing that; have a look on your man page 'man lp'

Regards, Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Just checked -- it is '-c' Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top