Sponsored Content
Top Forums Shell Programming and Scripting Insert FF (feed form) in text file so that when printing the printer print on a new page accordingly Post 303028709 by jcdole on Sunday 13th of January 2019 10:16:09 AM
Old 01-13-2019
If somebody has a better, shorter, cleaner solution tell me.

First create a groff file

Code:
echo "" > /tmp/part_list.groff echo ".nf" >> /tmp/part_list.groff  # NO FILL MODE 
FIRST_PASS="true"

for A_DEVICE in $(lsblk --noheadings -o kname) ; do
... 
...
...
    if [[ -z $FIRST_PASS ]] ; then
           echo ".bp" >> /tmp/part_list.groff  # do a page break if not processing the first device
        else
            FIRST_PASS=""
        fi
         CUR_DEVICE="$A_DEVICE"      # A_DEVICE = /dev/sda /dev/sdb /dev/sdc .....           
         gdisk -l "$CUR_DEVICE"  >>  /tmp/part_list.groff  2>&1  

done
 #
# Finished
#
echo ".pl -3" >> /tmp/part_list.groff  # i do adjustment because groff page length does not match 
                                                 # the page length of my laser printer
                                                 # so I got to much line feed.
echo ".ex" >> /tmp/part_list.groff     # No more to do

2) Build the text file :
Code:
groff -Tascii /tmp/part_list.groff > /tmp/part_list.txt

Any comment is welcome
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Form Feed...

Hi, I've a text file that has a formfeed character at the beginning. I want to get rid of this formfeed character using sed. But I don't know how to specify the formfeed character. I've tried \014 (octal for formfeed), \f but still not works. Regards, Johnny (5 Replies)
Discussion started by: johnny_woo
5 Replies

2. UNIX for Dummies Questions & Answers

Disable form feed on a serial printer connected to Sco OpenServer

I connected a serial printer to my scoOpenServer which works great. I was able to disable the banner in the interface of the printer. However i am unable to find the command in the interface to disable the formfeed . Below is a copy of the interface file. Please can anyone instruct me on how to... (0 Replies)
Discussion started by: scoman2
0 Replies

3. UNIX for Dummies Questions & Answers

Page feed in Troff

Hi, does anyone knows how to give the page feed command to Printer in troff. Actually I want to implement the functionality where I'll print say 10 pages and I want user to stop printer at 5th page to do manual feed by user .... (2 Replies)
Discussion started by: dpmore
2 Replies

4. Shell Programming and Scripting

replace last form feed with line feed

Hi I have a file with lots of line feeds and form feeds (page break). Need to replace last occurrence of form feed (created by - echo "\f" ) in the file with line feed. Please advise how can i achieve this. TIA Prvn (5 Replies)
Discussion started by: prvnrk
5 Replies

5. AIX

AIX printer and extra blank page after each print

Guy's I have installed AIX direct Network printer as the below details.... printer1 hp@printer1 hplj-3 (HP-GL/2) Printer is printing fain and clearly but it's printing extra blank page after each print ? What's the couse of this problem ? Pls advice ! (6 Replies)
Discussion started by: ITHelper
6 Replies

6. AIX

Printer delay before final form feed

Hi, I am new to printing with Unix (AIX on HP). I am printing from a COBOL program. On our test system the page prints and does a Form Feed to the next page. This is good. When I release the program to our customer it prints the page but waits 5 or more seconds before doing a page... (11 Replies)
Discussion started by: habler
11 Replies

7. Shell Programming and Scripting

print formatted text to the printer

Hello!!! I am using shell script that print some formated text on the screen (example) ======== hello I am ... ======== Is it possible to print this information to the printer exactly as I see it on the screen??? (6 Replies)
Discussion started by: tdev457
6 Replies

8. AIX

AIX Printer Issue: Blank Page Printing.

We have configured Network printers in AIX 6.1. We are facing a Weird problem in Printing. While printing the user is getting a blank page after 2 pages. Please let us know the cause of this issue and ways to rectify it. If this is problem with banner/feeds how to view the default banner... (1 Reply)
Discussion started by: sugan_p
1 Replies

9. Slackware

Printer won't print but 1 page

OS: Slackwar 13.37 Printer: hpDeskjet 1000 j110 Printer Drivers/Software: HPLIP 3.11.3a (min was 3.10.9) and Cups The printer will print the first of n-pages but from page 2 on it prints the page (or part of it) backs up and starts again down about 0.8 lines and does this repeatedly till the... (2 Replies)
Discussion started by: slak0
2 Replies

10. UNIX for Beginners Questions & Answers

Print a python script down a list in a text file without printing a lot combinations

In a python script I have 2 files printing side by side on the same line. I want to have 1 of the files to be already displayed at once while the other file print down the list in the file and it still will produce new lines. I want to do it like that to reduce printing a lot of lines and... (0 Replies)
Discussion started by: bigvito19
0 Replies
KATE(1) 							 KDE User's Manual							   KATE(1)

NAME
kate - Advanced text editor for KDE SYNOPSIS
kate [-s, --start name] [--startanon] [-n, --new] [-b, --block] [-p, --pid pid] [-e, --encoding name] [-l, --line line] [-c, --column column] [-i, --stdin] [-u, --use] [KDE Generic Options] [Qt Generic Options] DESCRIPTION
Kate is the KDE Advanced Text Editor. Kate also provides the editor part for various applications, under the name KWrite. Some of Kate's many features include configurable syntax highlighting for languages ranging from C and C++ to HTML to bash scripts, the ability to create and maintain projects, a multiple document interface (MDI), and a self-contained terminal emulator. But Kate is more than a programmer's editor. Its ability to open several files at once makes it ideal for editing UNIX(R)'s many configuration files. This document was written in Kate. OPTIONS
-s, --start name Start Kate with a given session. --startanon Start Kate with a new anonymous session, implies -n. -n, --new Force start of a new Kate instance (is ignored if start is used and another Kate instance already has the given session opened), forced if no parameters and no URLs are given at all. -b, --block If using an already running Kate instance, block until it exits, if URLs given to open. -p, --pid pid Only try to reuse kate instance with this pid (is ignored if start is used and another Kate instance already has the given session opened). -e, --encoding name Set encoding for the file to open You can use this to force a file opened in utf-8 format, for instance. (The command iconv -l provides a list of encodings, which may be helpful to you.) -l, --line line Navigate to this line -c, --column column Navigate to this column -i, --stdin Read the contents of stdin -u, --use Use an already running Kate instance; default, only for compatibility SEE ALSO
More detailed user documentation is available from help:/kate (either enter this URL into Konqueror, or run khelpcenter help:/kate). There is also further information available at the Kate website[1]. EXAMPLES
To open a file named source.cpp at column 15, line 25, in an existing Kate window, you could use: kate -c 15 -l 25 -u source.cpp If you have an active internet connection, you can take advantage of KDE's network transparency to open a file from an ftp site. If you do not have write permission on the remote server, the file will be opened read only and you will be prompted for a local filename to save to if you make changes. If you do have write permission, changes will be saved transparently over the network. kate ftp://ftp.kde.org/pub/kde/README AUTHORS
The maintainer of Kate is Christoph Cullmann<cullmann@kde.org>. A comprehensive list of authors and contributors is available in the complete user manual mentioned above. AUTHOR
Lauri Watts <lauri@kde.org> Author. NOTES
1. the Kate website http://kate-editor.org/ K Desktop Environment 2010-10-06 KATE(1)
All times are GMT -4. The time now is 12:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy