System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

"env" is not working in HP-UX 11.00

SOLVED
Go to solution
senthil_kumar_1
Super Advisor

"env" is not working in HP-UX 11.00

Hi

I am using HP-UX 11.00.

I issued following command to view the environmental variables.

EX:

# env

it is not giving any outputs.

But i am able to use echo to view the output of particular variable.

# echo $SHELL
/usr/bin/sh


For Your Information:

# which env
/usr/bin/env


How to make this command working.
7 REPLIES
Patrick Wallek
Honored Contributor

Re: "env" is not working in HP-UX 11.00

What does:

# ls -l /usr/bin/env

show?

From one of my 11.0 servers it is:

-r-xr-xr-x 1 bin bin 16384 Nov 7 1997 /usr/bin/env
James R. Ferguson
Acclaimed Contributor

Re: "env" is not working in HP-UX 11.00

Hi Senthil:

Verify the 'env' has not been aliased like:

# alias env='env -i'

Type:

# alias

...to see if it has.

If it has been aliased you can do:

# unalias env

...or simply run the absolute path as Patrick suggested:

# /usr/bin/env


Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: "env" is not working in HP-UX 11.00

Since you are using a real shell, you should use the following to see what env is:
whence -v env
senthil_kumar_1
Super Advisor

Re: "env" is not working in HP-UX 11.00

Hi All,

Pls find the outputs.

root@lgapps:/root > which env
/usr/bin/env

root@lgapps:/root > whereis env
env: /usr/bin/env /usr/share/man/man1.Z/env.1

root@lgapps:/root > whence -v env
env is /usr/bin/env

root@lgapps:/root > which env
/usr/bin/env

root@lgapps:/root > ll /usr/bin/env
-r-xr-xr-x 1 bin bin 0 Jun 22 17:51 /usr/bin/env

root@lgapps:/root > alias
D='export DISPLAY=lavxx08:0'
D2='export DISPLAY=lavpc03:0 ; unset LINES'
MD='export DISPLAY=AA215350:0'
autoload='typeset -fu'
c=clear
command='command '
functions='typeset -f'
glance='gpm &'
grep=/usr/bin/grep
h=history
history='fc -l'
integer='typeset -i'
l='ls -Fa'
local=typeset
mcd='mount /dev/dsk/c0t2d0 /cdrom'
nohup='nohup '
ps='ps -ef'
psg='/bin/ps -ef | grep -v grep | grep'
queback='/backup/bin/queback '
r='fc -e -'
rl=rlogin
stk='stk -m &'
stop='kill -STOP'
suspend='kill -STOP $$'
type='whence -v'
ucd='umount /SD_CDROM'
v=dtpad
vi=/usr/bin/vi
xomniback='xomniback &'
Sunny123_1
Esteemed Contributor
Solution

Re: "env" is not working in HP-UX 11.00

Hi

root@lgapps:/root > ll /usr/bin/env
-r-xr-xr-x 1 bin bin 0 Jun 22 17:51 /usr/bin/env

env is 0 byte.So it is corrupted try to get this from another equivalent server.

Regards
Sunny
James R. Ferguson
Acclaimed Contributor

Re: "env" is not working in HP-UX 11.00

Hi (again) Senthil:

Your problem is the someone truncated '/usr/bin/env':

-r-xr-xr-x 1 bin bin 0 Jun 22 17:51 /usr/bin/env

Note the size is zero! This would appear to have been done on June 22.

If you have another (same OS level) server you could copy the binary from there.

Regards!

...JRF...
senthil_kumar_1
Super Advisor

Re: "env" is not working in HP-UX 11.00

Hi Sunney and James,

Thanks a lot.

Now it is working fine after coping the file env from some other server.