LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-09-2016, 06:39 PM   #1
crimsin
LQ Newbie
 
Registered: Nov 2016
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 11-09-2016, 06:47 PM   #2
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
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

Last edited by Jjanel; 11-09-2016 at 06:52 PM.
 
Old 11-09-2016, 06:51 PM   #3
crimsin
LQ Newbie
 
Registered: Nov 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-09-2016, 07:06 PM   #4
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
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

Last edited by Jjanel; 11-09-2016 at 09:46 PM.
 
Old 11-10-2016, 12:00 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

Rep: Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192Reputation: 3192
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 )
 
Old 11-10-2016, 02:21 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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 ?

Last edited by John VV; 11-10-2016 at 02:23 PM.
 
Old 11-11-2016, 03:27 AM   #7
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 364Reputation: 364Reputation: 364Reputation: 364
Goo-ie 'Forensics' http://pastebin.com/7RhB9V2d Apr 1st, 2015! LINUX EXAM ch4,5,8 ?#35
 
1 members found this post helpful.
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Having trouble with my linux homework ruthmom1979 Linux - Newbie 11 09-15-2013 11:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration