LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Having trouble with Linux homework problem (https://www.linuxquestions.org/questions/linux-newbie-8/having-trouble-with-linux-homework-problem-4175593245/)

crimsin 11-09-2016 06:39 PM

Having trouble with Linux homework problem
 
I'm really stuck in this one

I have to Format a file called yourscript, to contain viewable pages, a heading, date, double spaced, and line numbers and send the output to the printer.

Jjanel 11-09-2016 06:47 PM

Welcome, BUT others will chastise you for not following 'how to ask questions':
what's your 'guess' on an answer, and more details...
What 'research' have you done? Have you searched for tutorials?
Also, tell us about what Linux you use....
Best wishes tho... A bit more & you'll succeed! hint: what do you think of: man pr

crimsin 11-09-2016 06:51 PM

My guess would be using the "pr" command, but I'm not sure how to add the date or line numbers.

What I have so far is: cat -n yourscript | pr -h”Heading” -dD | lp -printername

Jjanel 11-09-2016 07:06 PM

GREAT! From reading `man pr`, can you eliminate the `cat...|`, and the 'D'?
Hint: Post 'code' (use LQ Adv. formatting) of what the -n does, from man pr
Extra credit: edit just the title (post#1) to instead say: pr formatting options?
If you don't have a printer, try |more instead of `lp`. Post what you try.
Thanks for 'participating'! p.s. I was editing my #2, while you posted #3 ;)

grail 11-10-2016 12:00 AM

Jjanel has provided most of the good oil on where to go with this, so I will simply add that if you use [code][/code] tags around your code it is clearer and will stand out to those
trying to assist (this is also why it was suggested to use Adv. formatting :))

John VV 11-10-2016 02:21 PM

what tools are used in your textbook examples ?
you might want to use those

also what is the input ?
a html page?
a xml file
a CSV file ?

Jjanel 11-11-2016 03:27 AM

Goo-ie 'Forensics' ;) http://pastebin.com/7RhB9V2d Apr 1st, 2015! LINUX EXAM ch4,5,8 ?#35


All times are GMT -5. The time now is 04:24 PM.