Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > bash printing script help

bash printing script help
Thread Tools
Fresh-Faced Recruit
Join Date: Jan 2003
Status: Offline
Reply With Quote
Jan 13, 2003, 11:46 AM
 
I'm trying to make a script that autmatically prints all .doc files in a certain directory. after printing the file, the script should automatically delete it. i'm kinda new to shell scripting so a couple of hints would be greatly appreciated!
     
Forum Regular
Join Date: Nov 2002
Location: Ottawa, Canada
Status: Offline
Reply With Quote
Jan 17, 2003, 12:56 AM
 
Here goes something simple to get you started (completely untested)

#!/bin/sh

#MyVeryBestPrinter is your printer name
# This is where .doc files are
DOC_DIR="/path/to/whereever"

for FILE in $DOC_DIR/*.doc
do
lp -d "MyVeryBestPrinter" $FILE
rm -f $FILE
done

###
Now I am not sure CUPS will be able to deal with .doc files so you might have to install a filter of some sort for that (antiword is a good candidate) or convert them to PDF (CUPS can deal with PDF,PS...).

HTH
     
Fresh-Faced Recruit
Join Date: Jan 2003
Status: Offline
Reply With Quote
Jan 17, 2003, 10:01 AM
 
thanks! i'll try that!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2