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 303028680 by jcdole on Saturday 12th of January 2019 01:15:07 PM
Old 01-12-2019
Insert FF (feed form) in text file so that when printing the printer print on a new page accordingly

Hello.
First happy new year to everybody.


I have a script that generate a text file ( /tmp/part_list.txt for example ).
This file can be edited using a kde graphical text editor like kate or kwrite
The file can be printed out from command line or within the text editor using the print option menu.



Code:

echo "" > /tmp/part_list.txt
echo "" > /tmp/part_list.txt
 
for A_DEVICE in $(lsblk --noheadings -o kname) ; do...
...
        CUR_DEVICE="$A_DEVICE"      # A_DEVICE = /dev/sda /dev/sdb /dev/sdc .....  
        gdisk -l "$CUR_DEVICE"  >>  /tmp/part_list.txt  2>&1

done

Now I would like to add the code so that when printing the file "/tmp/part_list.txt" the printer change page after each device
Something like that :



Code:

echo "" > /tmp/part_list.txtecho "" > /tmp/part_list.txt

for A_DEVICE in $(lsblk --noheadings -o kname) ; do...
...
        CUR_DEVICE="$A_DEVICE"      # A_DEVICE = /dev/sda /dev/sdb /dev/sdc .....  
        gdisk -l "$CUR_DEVICE"  >>  /tmp/part_list.txt  2>&1
        echo "some code that printer understand as do FF" >> /tmp/part_list.txt  
done

And then the file "/tmp/part_list.txt" contains some thing like :


Code:
device : /dev/sda

ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
0x0c  or  do FF or .....?
device : /dev/sdb

ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
ligne of text0x0c  or  do FF or .....?
device : /dev/sdc

ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
ligne of text
ligne of text

Any help 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
mbk2eagle     01/07/2002 ________________________

Cet  outil  permet, a partir d'une description structurelle d'une
carte (.vst), de generer un fichier script utilisable  par  Eagle
(logiciel  de routage de cartes).  Ce fichier permet de fournir a
Eagle, la liste des composants utilises ainsi que  l'interconnex-
ion de ces composants.

La  description  structurelle doit etre completee par trois types
de fichiers.  - Un fichier ";nom__de_figure.pin"  correspondant	a
la description des connexions de
  la  carte  circuit imprime, avec son environnement (connecteurs
de la carte).  - Un ou plusieurs fichiers ";composants.pin" corre-
spondants aux differents modeles de
  composants  qui doivent etre implantes sur la carte circuit im-
prime.	- Un fichier "nom__de_figure.cls" dans lequel on  definit
la classe des
  signaux  ainsi  que la rotation et le placement des differentes
instances
  des modeles. Par defaut la classe d'un signal est la classe 0.

Dans les fichiers, les lignes vides ou commencant par # sont  ig-
norees.

1.	 Organisation	  du	 fichier     "nom__de_figure.pin"
________________________________________________

Dans ce fichier on doit placer,  pour  chaque  connecteur  de  la
carte, les 2 rubriques dans l'ordre :

Rubrique  1  ----------  /MODELE  <instance>  <modele> <rotation>
<(coordonnees)>

<instance> correspond au nom d'instance du connecteur.

<modele> correspond au nom du fichier  Eagle  decrivant  le  con-
necteur. Il est de la forme : nom_modele@nom_bibliotheque

<rotation> On peut mettrel'une des valeurs : R0, R90, R180, R270.

<(coordonnees)>  position provisoire du connecteur (x y). Il doit
etre entierement dans la zone utilisable actuellement 100x160 mm.

Rubrique 2 ---------- /CONNECTEURS

On enumere les signaux du connecteur a	raison	d'un  signal  par
ligne, sous la forme :

<repere de broche> <nom du signal>

EXEMPLE
/MODELE P1 IBM8BIT@con-pc R90 (6.5 0.5) /CONNECTEURS B1 VSS B3 VDD B29 VDD B31 VSS A2 DATA(7) A3 DATA(6) A4 DATA(5) A5 DATA(4) A6 DATA(3) A7 DATA(2) A8 DATA(1) A9 DATA(0) A11 AEN 2. Organisation des fichiers "composants.pin" ______________________________________________ Dans ce fichier doit placer 2 rubriques dans l'ordre : Rubrique 1 ---------- /MODELE <modele> <modele> correspond au nom du fichier Eagle decrivant le connecteur. Il est de la forme : nom_modele@nom_bibliotheque Rubrique 2 ---------- /CONNECTEURS On enumere les signaux du composant sous la forme : <repere de broche> <nom du signal> EXEMPLE
/MODELE DIL08@dil (0.5 3.0) /CONNECTEURS 1 DATA 2 CLK 3 OE_N 4 CE_N 5 VSS 6 CEO 7 VPP 8 VDD 3. Organisation du fichier "nom__de_figure.cls" ________________________________________________ Dans ce fichier doit placer 2 rubriques dans l'ordre : Rubrique 1 ---------- /CLASS On enumere ensuite les signaux avec leur numero de classe, a rai- son d'un signal par ligne, sous la forme : <nom du signal> <numero de la classe> Inutile d'enumerer les signaux de classe 0. Cette rubrique peut etre vide, mais il doit y avoir ";/CLASS". Rubrique 2 ---------- /PLACEMENT On enumere ensuite les instances avec la rotation a effectuer et les coordonnees de placement, a raison d'une instance par ligne, sous la forme : <nom de l'instance> <rotation> <coordonnees> <rotation> On peut mettrel'une des valeurs : R0, R90, R180, R270. <(coordonnees)> position provisoire du composant (x y). Il doit etre entierement dans la zone utilisable de la carte, actuellement 100x160 mm. EXEMPLE
/CLASS CLK 1 VSS 2 VDD 2 /PLACEMENT IC1 R90 (4.25 1.2) IC2 R180 (3.25 1.2) IC3 R0 (3.25 1.4) 4. Ligne de commande _________________ m2e [-v n ] [-o output] figure -v definit le niveau des messages affiches ; par defaut 1 si 0 : affiche seulement les erreurs si 1 : af- fiche les erreurs et les warning si 2 : affiche en plus les noms des fichiers .pin utilises si 3 : mode trace pour le debug 5. Variable d'environnement ________________________ M2E_PIN_LIB doit etre definie. Elle donne les chemins d'acces aux fichiers .pin
All times are GMT -4. The time now is 12:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy