LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2004, 01:23 PM   #1
fisheromen1031
Member
 
Registered: Jun 2004
Location: Lone Star State
Distribution: WinXP Pro, Puppy Linux, Ubuntu Warty & Hoary
Posts: 46

Rep: Reputation: 15
printing line numbers?


Is there a way to make lpr print the line numbers?
 
Old 07-27-2004, 02:19 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
The base options for POSIX 2 lp and friends doesn't include a line number.

If you find your printer in /etc/lp/interface (I think that's where it is in Linux, someone correct me), you can see what options your printer driver supports. This is totally installation dependent, nothing else.

Then if you find one that meets your needs
Code:
lp -o option_whatever <filename>
If that doesn't work for you try:
Code:
#!/bin/ksh
# prline
# add line numbers
# $1 = file name
#
let line=0
while read text
do
      let line=line+1
      printf  "%5d " $line
      printf "%s\n" $text
done < $1
usage: prline oldfilename > newfilename
then lp the newfilename
 
  


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
how do i show line numbers in kdevelop? ereeno Linux - Software 3 12-17-2008 02:16 AM
Vim: Starting line numbers from 0 funkymunky Linux - Software 0 11-27-2005 06:40 PM
Prepend # for certain line numbers in VI twantrd Linux - Software 3 09-05-2005 01:27 PM
printing numbers without using semicolon vijeesh_ep Programming 18 09-08-2004 11:59 AM
line numbers in kdevelop febisfebi Programming 1 02-18-2004 07:45 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:30 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