Operating System - HP-UX
1754123 Members
4173 Online
108811 Solutions
New Discussion юеВ

Hacking rmodel print script to remove 1st char if it is a FF?

 
SOLVED
Go to solution
Scott Donaldson
Advisor

Hacking rmodel print script to remove 1st char if it is a FF?

Hi,

I am modifying the rmodel script to deal with an OLD database that thinks that all printers are impact line prints.

I have added Start-of-Job and End-of-Job strings. But now I need to find a way to remove the first character of the print job If-and-only-if it is a FF (form-feed: X012, Octal 014) character. I've tried to use sed, and scripted ed but am not having much luck. My bourne-sh script using sed looks as such:

#!/bin/sh
echo "\014" > var1
var2=""
/usr/bin/sed '1s/'$var1'/'$var2'/1' dA4330hostname > noff.txt

Remember I just want to remove the 1st char of the file if it is a FF (duplexing issue!).

And I am modifying the /var/spool/lp/model/rmodel interface script within the lp subsystem (on a 10.20 box if that helps).

TIA.
2 REPLIES 2
Jitendra_1
Trusted Contributor

Re: Hacking rmodel print script to remove 1st char if it is a FF?

Hi ,

I believe to find the first character using sed , you need to give,
sed '/^$VAR1/s//$VAR2/' ....
instead of sed '1s/...'
Learning is the Key!
James R. Ferguson
Acclaimed Contributor
Solution

Re: Hacking rmodel print script to remove 1st char if it is a FF?

Scott:

Try this:

#!/usr/bin/sh
var=`echo "\014"`
sed '1s/'$var'//1' dA4330hostname > noff

...JRF...