Print files with certain length filename

Booting, installing, newbie
Post Reply
Message
Author
p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

Print files with certain length filename

#1 Post by p310don »

I have devised a script that massively saves my time at work.

I send products out via courier, and as part of that process I print out a shipping label to attach to the product being shipped.

I have found that if I use Firefox to create the shipping labels, I can open all the pdf files generated, and then go to /tmp/mozilla_root0 folder and type lpr *.pdf it prints out all the pdf files.

Now this is great except, Thunderbird also uses that directory to store it's temporary files, so there is the risk of typing lpr *.pdf that everything I have looked at that day gets printed. I don't want that, just the shipping labels.

Now, the shipping labels always have a filename that is 6 characters long. What I'd like to know is if there is a way to make the script only print out PDF files that have only 6 characters long?

Is that too hard, of would it be easier to change the tmp directory for thunderbird?

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#2 Post by rcrsn51 »

Try: lpr ??????.pdf

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#3 Post by p310don »

WOW.

How awesome is Linux?

How awesome are you rcrsn51?

3 minutes with a solution.

I am not 100% certain that that works, as I am at home and not at work to test it, but I tried it with the cp command and it works, so I'm guessing it will work with the lpr command. (the cp command also gets some time in my script so even if the printing doesn't work, your answer is still awesome)

Will test tomorrow at work to make sure it works how I need it to, and will report back.

Thank you

User avatar
Burn_IT
Posts: 3650
Joined: Sat 12 Aug 2006, 19:25
Location: Tamworth UK

#4 Post by Burn_IT »

The same works in Windows!!!
"Just think of it as leaving early to avoid the rush" - T Pratchett

p310don
Posts: 1492
Joined: Tue 19 May 2009, 23:11
Location: Brisbane, Australia

#5 Post by p310don »

The same works in Windows!!!
ssshhhh, keep it down. Linux good, Windows bad.

I have tested, it works 100%. Thank you.

Post Reply