Advertisement

06.20.2008 at 12:27PM PDT, ID: 23503392
[x]
Attachment Details

Looking for help w/bash script that will remove a file if present

Asked by jlinde in IBM AIX Unix, Unix Operating Systems, Linux

Tags: Bash Scripting

I am running AIX 5.2 at the office and have many system printers. It seems that when users print a file called 3ALSE is created in the /var/spool/lpd/qdir/ which prevents me to cancel print jobs till deleted. I am looking for help writing a script that will cd to that directory and look for that file. If that file is there I would like for it to be removed. if the file is not, than I would like it to be a no action.

I have tried many if/else/then statements, but just cant get it to work right.

I would like to run this under cron every few minutes and when I do a simple bash script that cd's to the dir and rm -r the file my log file fills up if that file isnt present.

SIGH!!!!

Any help for me?

Thank you in advance...Start Free Trial
 
Loading Advertisement...
 
[+][-]06.20.2008 at 01:00PM PDT, ID: 21834436

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 01:33PM PDT, ID: 21834690

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 01:37PM PDT, ID: 21834729

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 03:08PM PDT, ID: 21835307

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 03:47PM PDT, ID: 21835473

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: IBM AIX Unix, Unix Operating Systems, Linux
Tags: Bash Scripting
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.21.2008 at 05:17PM PDT, ID: 21839264

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628