Operating System - HP-UX
1833827 Members
2254 Online
110063 Solutions
New Discussion

self test printer and use how to use history

 
siva baskaran
Regular Advisor

self test printer and use how to use history

Dears,

i needed how give self test pages from hpux server to network printer by through SAM and command prompt, and one more how to use history on hpux like how to use previous command
thanks
siva
2 REPLIES 2
Kent Ostby
Honored Contributor

Re: self test printer and use how to use history

siva ...

I don't know about printers, but as far as using the history file, you can set up the location for where you want it to go via the .profile of the user.

We have a shared user where we create a different history file for each login using:

export HISTFILE=~/.hist.$$

You can also get the last N number of commands by doing:

history -N

e.g. history -100

I will sometimes do this if I am creating a script step by step in the shell and then want to capture the commands I used:

history -10 > somefile

then I edit "somefile" and clean things up a bit.

You can also reference the number by doing "r N" so for instance:

history
7 elm
8 ozmake 3214663054
9 cd ../3214663054
10 elm
11 fix incoming.new.wed.803
12 more ana.txt
13 ll
14 ozmake 3214655619
15 cd ../*55619
16 cd
17 rm outgoing.1
18 vi outgoing.2
19 cd
20 cd ../3214509120
21 ftp hprc
22 grep -i hist ~/.profile

If I wanted to re-run the "grep" command in 22, I could type "r 22" and hit return.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
JASH_2
Trusted Contributor

Re: self test printer and use how to use history

Siva,

To send a test page to a printer from the command line, you could:-

banner "this is a test page"|lp -printername

Don't know about SAM.

Regards,

JASH
If I can, I will!