06-28-2005
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 disable the file.
--------------------------------------------------------------------------
#Set up some global variables.
: ${SPOOLDIR:=/usr/spool/lp}
: ${LOCALPATH:=${SPOOLDIR}/bin}
#Set up the default filter.
if [ -x "${LOCALPATH}/lp.cat" ]
then
LPCAT="${LOCALPATH}/lp.cat 0"
else
LPCAT="cat"
fi
#If we are not using a filter, use the default one.
if [ -z "${FILTER}" ]
then
FILTER="${LPCAT}"
fi
if [ -x "${LOCALPATH}/drain.output" ]
then
DRAIN="${LOCALPATH}/drain.output 1"
else
DRAIN=
fi
nobanner="yes"
if [ -z "${BANNERS}" ]
then
nhead=0
else
nhead=${BANNERS}
fi
for i in $5
do
case "${i}" in
nobanner )
nobanner="yes"
;;
esac
done
if [ "no" = "${nobanner}" ]
then
while [ $nhead -gt 0 ]
do
# echo "\014\c"
echo "$x\n$x\n$x\n$x\n"
banner "$2"
echo "\n"
user=`grep "^$2:" /etc/passwd | line | cut -d: -f5`
if [ -n "$user" ]
then
echo "User: $user\n"
else
echo "\n"
fi
echo "Request id: $1 Printer: `basename $0`\n"
date
echo "\n"
if [ -n "$3" ]
then
banner $3
fi
nhead=`expr $nhead - 1`
done
fi
copies=$4
#echo "\014\c"
shift; shift; shift; shift; shift
files="$*"
i=1
while [ $i -le $copies ]
do
for file in $files
do
0<${file} eval ${FILTER} 2>&1
echo "\014\c"
done
i=`expr $i + 1`
done
if [ "no" = "${nobanner}" ]
then
echo "$x\n$x\n$x\n$x\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n$x\n$x\n$x\n$x"
echo "$x\n$x\n$x\n$x\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
echo "$x\n$x\n$x\n$x\n$x\n$x\n$x\n$x\n"
fi
#Draining characters might be necessary.
${DRAIN}
exit 0
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
is there a way to get information of an annex device connected to port A ? i need to get the I.P address of the annex and the port
it connected to on the annex.
dori (1 Reply)
Discussion started by: dorilevy
1 Replies
2. UNIX for Dummies Questions & Answers
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
3. SuSE
If all else fails, ask right??
I am a Linux Newbie (that's an understatement) and I am trying to setup a printer that is connected to a WinXP machine on a local network. I am using SuSE 9.0 and am using YaST to connect to the printer. The problem is that I keep receiving an NT_ACCESS_DENIED... (1 Reply)
Discussion started by: maelgwyn
1 Replies
4. UNIX for Dummies Questions & Answers
i have wipro netpower server with p4 and 256 ram.
i want share dot matrix printer installed on windows 2000 prof.
with sco openserver 5.0.5. plz help me to comeout from this trouble. (0 Replies)
Discussion started by: raj_shivage
0 Replies
5. UNIX for Dummies Questions & Answers
I currently access a remote Unix server which has an external modem connected to one of it's serial ports (/dev/cua/b). At times, this server undergoes a hard reset and for some reason this disallows us from making use of the modem any longer. A hard reset of the modem always seems to fix the... (0 Replies)
Discussion started by: ebender1
0 Replies
6. UNIX for Dummies Questions & Answers
I only know enough about Unix to get me in trouble:
I have an old UNIX SCO OpenServer 5 that I am phasing out. It had been connected to an HP laserjet via a serial port connection. As part of the phase out I disconnected and removed the workstations leaving only the server. I didn't think I... (9 Replies)
Discussion started by: rpmaps
9 Replies
7. Shell Programming and Scripting
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
8. Solaris
Hi All.. No Labor Day weekend for me.. too much to do. 1 of which is that I have been pulling my hair out trying to get a 1-way serial feed working from a Linux box running Centos to a Solaris 10 box. The serial feed consists of a blackbox fiber driver on each end connected with 1 strand of fiber... (6 Replies)
Discussion started by: HawaiiMike
6 Replies
9. AIX
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
10. Shell Programming and Scripting
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... (5 Replies)
Discussion started by: jcdole
5 Replies
ECHO(3) 1 ECHO(3)
echo - Output one or more strings
SYNOPSIS
void echo (string $arg1, [string $...])
DESCRIPTION
Outputs all parameters.
echo is not actually a function (it is a language construct), so you are not required to use parentheses with it. echo (unlike some other
language constructs) does not behave like a function, so it cannot always be used in the context of a function. Additionally, if you want
to pass more than one parameter to echo, the parameters must not be enclosed within parentheses.
echo also has a shortcut syntax, where you can immediately follow the opening tag with an equals sign. Prior to PHP 5.4.0, this short syn-
tax only works with the short_open_tag configuration setting enabled.
I have <?=$foo?> foo.
PARAMETERS
o $arg1
- The parameter to output.
o $...
-
RETURN VALUES
No value is returned.
EXAMPLES
Example #1
echo examples
<?php
echo "Hello World";
echo "This spans
multiple lines. The newlines will be
output as well";
echo "This spans
multiple lines. The newlines will be
output as well.";
echo "Escaping characters is done "Like this".";
// You can use variables inside of an echo statement
$foo = "foobar";
$bar = "barbaz";
echo "foo is $foo"; // foo is foobar
// You can also use arrays
$baz = array("value" => "foo");
echo "this is {$baz['value']} !"; // this is foo !
// Using single quotes will print the variable name, not the value
echo 'foo is $foo'; // foo is $foo
// If you are not using any other characters, you can just echo variables
echo $foo; // foobar
echo $foo,$bar; // foobarbarbaz
// Some people prefer passing multiple parameters to echo over concatenation.
echo 'This ', 'string ', 'was ', 'made ', 'with multiple parameters.', chr(10);
echo 'This ' . 'string ' . 'was ' . 'made ' . 'with concatenation.' . "
";
echo <<<END
This uses the "here document" syntax to output
multiple lines with $variable interpolation. Note
that the here document terminator must appear on a
line with just a semicolon. no extra whitespace!
END;
// Because echo does not behave like a function, the following code is invalid.
($some_var) ? echo 'true' : echo 'false';
// However, the following examples will work:
($some_var) ? print 'true' : print 'false'; // print is also a construct, but
// it behaves like a function, so
// it may be used in this context.
echo $some_var ? 'true': 'false'; // changing the statement around
?>
NOTES
Note
Because this is a language construct and not a function, it cannot be called using variable functions.
SEE ALSO
print(3), printf(3), flush(3), Heredoc syntax.
PHP Documentation Group ECHO(3)