- Integrated Systems
- About Us
- Integrated Systems
- About Us
06-15-2011 03:18 AM
I would like to edit the spooler destination.
I know that LPDEST from env is the place to make the change.
1. Is there a possible to edit the env itself (i guess not, but just to be sure).
2. How can I set env parameters?
3. where can I define the spooler destination?
Solved! Go to Solution.
06-15-2011 06:33 AM
Now, this user will automatically print to prn32.
On the other hand, if you only have one printer, just use the command:
and now, all users will print to the same printer without having to use the lp -d option.
Bill Hassell, sysadmin
06-15-2011 06:39 AMSolution
"env" is not a file or a place: it is one of the many ways to display all the environment variables that are currently set.
To see all the configured spooler destinations, run "lpstat -p". The output should look like this:
$ lpstat -p
printer foobar is idle. enabled since Jan 28 15:00
fence priority : 0
In the above example, there is only one spooler destination, "foobar".
If you want to configure more spooler destinations (= printers), use SAM/SMH, or commands "lpadmin" or "addqueue" (for network printers only).
To set environment variables like LPDEST, you first need to know which shell you're using. The command "echo $SHELL" might be helpful here.
If you're using tcsh or csh (yuck), you can set/overwrite environment variables with commands like:
setenv VARIABLE value
setenv LPDEST foobar
If the variable already exists, the new value will overwrite the old one automatically.
To unset (remove) a variable with tcsh or csh:
With most other shells (i.e. the Bourne/POSIX-style shells) like sh, ksh, bash and zsh, the commands are slightly different.
In these shells, there are two common ways to set an environment variable:
To unset(delete) an environment variable in Bourne/POSIX-style shells:
The environment variables are specific to each process. A child process receives a copy of its parent's environment variables at the moment of its creation.
(That is, assuming the variable is *exported*: in csh/tcsh, all environment variables are exported by default. In Bourne/POSIX shells, if the "export" command is not used, the variable will not be copied to the environment of the child processes; it will be available for the shell itself only.)
Each process can only change its own environment variables.
The environment variables are not persistent: if you set them in your login session and then log out, you'll need to set them again in your next session. To set an environment variable persistently, you'll need to add a command to set the variable in your login script, so that the variable will be automatically set as you want it each time you log in.
06-15-2011 11:27 PM
I know you all avoid of working with tcsh but this is the shell running here.
(This is due to comfortable environment reasons for users, such as up arrow for last command) hence setenv (so does export) is not available.
The users use a print script called sps which defines the $LPDEST for pe2 printer.
So, how and where can I set LPDEST (script; env).
I attached the script as well.
06-16-2011 02:20 AM
Of course setenv is available, you are using the scummy C shell or its improved derivative, tcsh.
This script assumes that LPDEST has already been exported before you invoke it.
So as MK said, you can export it in your scummy C shell ~/.login profile:
setenv LPDEST some-printer
Or the user can invoke that setenv in his session, sometime before printing.
06-16-2011 02:58 AM
> comfortable environment reasons for users,
> such as up arrow for last command) [...]
06-19-2011 12:28 AM
I would like to download bash from the link you sent http://hpux.connect.org.uk/hppd/hpux/Shells/bash-4.2/) for 11.11v.
It is with .gz extension.
Should I copy it to /sbin and istall it there? How to Install?
06-19-2011 04:55 AM
This is pretty common knowledge. Did you try
anything simple like a Web search for, say,
? Google works for me. Or:
Or the FAQ link at the top of that Web page?
4. SOURCE PACKAGE DISTRIBUTIONS
4.1 How do I unpack the sources?
If this remains a mystery, then you might try
to find some local help.
06-19-2011 05:04 AM
> Should I copy it to /sbin [...]
Normally, anyone who has the "root" password
should already know these things. Or be
reading much more about HP-UX (or UNIX in
general) then he'll find in answers here.
06-19-2011 10:34 PM
Handling with .gz is well known. That was not the issue.
Obviously, I am not the scholar sys admim and I just try to learn the matter.
I probably should go back to the books. Thank you for your help.