Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
So i have an assignment and im new to bash, and ive been on the first question worth 3% for hours. It is discouraging.
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
Here I'm assuming that the files are just plain text.
First you can concatenate the files using the 'cat' command, then you can convert the output to postscript format and send it to a printer with the 'a2ps' command.
Do some research on those two commands and try to work out how to put it all together. If you get stuck post back showing what you have tried.
If i did this: cat file1.txt file2.txt | lp -d printer
it sent one file to the printer i told it too (I think) But I don't think that the file names were included in the printout, which is what I need. I ran through the man pages for lp and lpr, and the only thing I saw that might have helped was -0 number-up=16 for lp which only put 16 files onto the page. When I tried to print using lp with this, it didn;t work (got an error).
are there any other print functions that I could take a look at that might be able to include the file names?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.