lp -o <option> doesn't work


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers lp -o <option> doesn't work
# 1  
Old 10-10-2008
lp -o <option> doesn't work

why lp -o <option> doesn't work on my SCO Unix.
# 2  
Old 10-10-2008
Question what is not working?

Is it giving a syntax error on the command, or is the command not changing (altering) the print option?
# 3  
Old 10-10-2008
Wendyz -
From your other thread - your Fujitsu printer responds to EPSON printer commands:
SI is ascii 15 - DC2 is ascii 18

SI turns on condensed mode printing.
DC2 turns off consdensed mode printing.

You will have to embed an SI character - not a literal "SI" but as an unreadable character as the first character in your document. The last character will have to be a DC2. Also unreadable.

Assuming you are not in some bizarre shell and you have a document to print.
Let's assume the document is in a file named docfile. And that you want to keep docfile on disk without weird characters in it.
Code:
echo "\017" > tmp
cat docfile >> tmp
echo "\022" >> tmp
lp -d myprinter tmp

You do not need a -o <option> You are forcing the options yourself.

\017 is the SI character, \022 is the DC2 character. You need quotes around them like this: "\017" The "name value" of the character is 017, but you need a backslash in front of it so unix sees it as an octal value, not a literal character.

I'm surprised your syadmin can't setup cups to drive the printer for you.

Finally - suppose you don't like compressed mode, you want a different font setting.
Then you get to go to websites:
one with octal (the \017 thing) values for characters:
Ascii Table - ASCII character codes and html, octal, hex and decimal chart conversion

one with the epson manual for printer control codes:
http://support.epson.ru/products/man...0350/part1.pdf

You then need to read the manual, get the control code sequences you want - finally embed them in your document. Many of the sequences are several weird characters all together, and many of them start with the escape character - so we call them "escape codes" or "escape sequences"
# 4  
Old 10-10-2008
some give error message, like when I use lp -o cpi=12, it will show error message said that can't handle cpi=. And some options I use, the output didn't change anything but still can print out.
# 5  
Old 10-10-2008
Thanks very much! Now it works. Any one question: how can I select pages which I want to print out. Like I have 10 pages and I just want to print 1st, 3rd page, how can I do. By the way, -o<option> doesn't work.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

-ne 0 doesn't work -le does

Hi, I am using korn shell. until ] do echo "\$# = " $# echo "$1" shift done To the above script, I passed 2 parameters and the program control doesn't enter inside "until" loop. If I change it to until ] then it does work. Why numeric comparison is not working with -ne and works... (3 Replies)
Discussion started by: ab_2010
3 Replies

2. Shell Programming and Scripting

Why my awk doesn't work?

root@SDP_Wildcat_Pass-3-C1:~# cat /proc/driver/rtc rtc_time : 05:29:40 rtc_date : 2014-12-19 alrm_time : 01:51:53 alrm_date : 2014-12-20 alarm_IRQ : no alrm_pending : no update IRQ enabled : no periodic IRQ enabled : no periodic IRQ... (4 Replies)
Discussion started by: yanglei_fage
4 Replies

3. UNIX for Dummies Questions & Answers

Why doesn't this work?

find . -name "05_scripts" -type d -exec mv -f {}/'*.aep\ Logs' {}/.LogFiles \; Returns this failure: mv: rename ./019_0120_WS_WH_gate_insideTEST/05_scripts/*.aep\ Logs to ./019_0120_WS_WH_gate_insideTEST/05_scripts/.LogFiles/*.aep\ Logs: No such file or directory I don't know why it's trying... (4 Replies)
Discussion started by: scribling
4 Replies

4. Shell Programming and Scripting

HELP: If Doesn't Work in AWK

Hi! I have a somehow big file (almost 3000 lines long and thirteen columns). Some lines have no value at all or, at least, are incomplete. The columns' values that have no data are marked with a "-" and the corresponding line (the line that owns that value) should be discarded and not used. ... (5 Replies)
Discussion started by: Marcelo de Brit
5 Replies

5. UNIX for Dummies Questions & Answers

useradd doesn't work! why??

# uname -a Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux # useradd 4141421248 useradd: invalid user name '4141421248' why??? (6 Replies)
Discussion started by: cqlouis
6 Replies

6. Shell Programming and Scripting

for loop doesn't work

I have a script which uses below for loop: for (( i = 0 ; i <= 5; i++ )) do echo "Welcome $i times" done But when I run the script, it gives error message: Syntex Error : Bad for loop variable Can anyone guide to run it? Thanks in advance. (10 Replies)
Discussion started by: naw_deepak
10 Replies

7. UNIX for Dummies Questions & Answers

Script doesn't work, but commands inside work

Howdie everyone... I have a shell script RemoveFiles.sh Inside this file, it only has two commands as below: rm -f ../../reportToday/temp/* rm -f ../../report/* My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies

8. UNIX for Dummies Questions & Answers

my ctrl+c doesn't work

it seams that my ctrl+c and my ctrl+d don't work. if I type a bunch of jiberish on a line and ctrl+c I expect the command to be cancelled and to be given a fresh prompt, but instead it just putts ^C at the end of the line. Also, ctrl+d should close the session, but instead mine just puts ^D at... (3 Replies)
Discussion started by: yankee428
3 Replies

9. Shell Programming and Scripting

Why doesn't this work?

cat .servers | while read LINE; do ssh jason@$LINE $1 done exit 1 ./command.ksh "ls -l ~jason" Why does this ONLY iterate on the first server in the list? It's not doing the command on all the servers in the list, what am I missing? Thanks! JP (2 Replies)
Discussion started by: jpeery
2 Replies
Login or Register to Ask a Question