Bash or Puthon script to read and print postscript (ps) files from a directory
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Bash or Puthon script to read and print postscript (ps) files from a directory
I am pretty new to Scripting Languages, and was trying to learn Bash Shell Scripting for reading and printing PostScript (PS) files from a directory (which may contain 10000's of files) in Linux environment. Basically you can call it as a bulk print processing job. This script will involve filtering of files bases on some criteria involving both floating point numbers and string characters on which search will be done (something like a 'grep' or 'sed' in Shell), and so involves reading files also.
Now, as I have continued learning Bash Shell Scripting, I came to know about python scripts which typically can do anything which a Shell Script can do and becomes much more efficient when (1)not dealing with system admin task (which in this case is true), and (2)when the file becomes large (typically more then 1000 lines, I think I will get around something 500-600 lines when finished)
So here's my Question, Now that I am learning (from scratch), so should I go with Bash Shell Script or Python Shell Script, given the condition that (1)I am not thinking of making my script portable to other platform, (2)I have basic requirement of dealing with ps files (or some other non-system, text files) and (3)I want to buil a really fexible script which can take input much like any of the Linux native system commands (like, cp, ls, dd etc)
I actually might vote for BASH because I think it's closer to the shell and you'll be using a lot of shell commands. But given your comment about floating point, that would be python. Why that requirement though?
personaly i would stick with bash until you hit a point where you need something a little more robust then i would switch. however bash can solve alot and is really quick to implement for an admin
These are basically Telephone Bills, which needs to be filtered based on different criteria like amount, address and exchange_code, it requires comparing with floating point and strings.
Also, I too was working with bash initially as it represents virtual shell, but then for this particular task, I don't require Admin task.
And then, the most important thing, is yes my command will basically revolve around this command
lpr *.ps
which though I din't thought initially, but then with bash I am not able to find much help in dealing with *.ps files, and neither bash is an intuitive language
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.