Operating System - HP-UX
1748180 Members
3864 Online
108759 Solutions
New Discussion юеВ

Re: ${HOME:-.}/.profile[22]: test: argument expected

 
Ravi S. Banda
Regular Advisor

${HOME:-.}/.profile[22]: test: argument expected

We had to reboot one of our hp-ux 11i v1 servers (n4000 model). Everything gets mounted, file system sanity check is OK, afterwards, peculiarly, these errors appear infinitely (hundreds of lines and counting)...

${HOME:-.}/.profile[22]: test: argument expected
${HOME:-.}/.profile[41]: test: argument expected
${HOME:-.}/.profile[44]: test: argument expected
${HOME:-.}/.profile[47]: Q: unknown test operator
${HOME:-.}/.profile[22]: test: argument expected
${HOME:-.}/.profile[25]: test: argument expected

it never starts any services and coming to the (console) login prompt.

I logged in Single-user mode, renamed .profile, copied from /usr/newconfig/etc/profile to $HOME, added only 2 lines, tried everything related to the .profile file, hard-booted by 'resetting', but it still reads the same .profile from somewhere and gives the error on the same exact lines - 22, 25, 29, 32, 35, 38, 41, 44, 47. I don't know where it is even reading it from.

anyone has any ideas?!

Thanks!
Ravi.
16 REPLIES 16
James R. Ferguson
Acclaimed Contributor

Re: ${HOME:-.}/.profile[22]: test: argument expected

Hi:

Posting the errant '.profile' would help, especially since you "added only 2 lines".

Regards!

...JRF...
Ravi S. Banda
Regular Advisor

Re: ${HOME:-.}/.profile[22]: test: argument expected

No, I didn't add just 2 lines - I was just saying that I tried various ways - including adding just 2 lines. that didn't help either.

the current .profile that is located under $HOME (copied from /usr/newconfig/etc/profile) will be attached.

Thanks!
Ravi.
Ravi S. Banda
Regular Advisor

Re: ${HOME:-.}/.profile[22]: test: argument expected

attachment.
Tim Nelson
Honored Contributor

Re: ${HOME:-.}/.profile[22]: test: argument expected

is this diplaying on the console ?
in the syslog.log ?

even before you log in ?
after you log in ?

Ravi S. Banda
Regular Advisor

Re: ${HOME:-.}/.profile[22]: test: argument expected

I logged into the console. On the screen itself. I couldn't even login because the above messages appear infinitely!

ps: I do have a case open with hp support - but so far, he is clueless!
Tim Nelson
Honored Contributor

Re: ${HOME:-.}/.profile[22]: test: argument expected

My first thought is a bad inittab entry trying to start a service on boot.

check out any entries in there that look to be running some errant script that possible may "su" to some user, that users .profile is probably the one with the issue.

Dennis Handly
Acclaimed Contributor

Re: ${HOME:-.}/.profile[22]: test: argument expected

>the current .profile that is located under $HOME (copied from /usr/newconfig/etc/profile) will be attached.

.profile and /etc/profile are different. Did you attach the proper file?

Typically that error occurs due to sloppy programming and variables not being set, or containing whitespace or "-".
Ravi S. Banda
Regular Advisor

Re: ${HOME:-.}/.profile[22]: test: argument expected

the analyst asked me to copy /usr/newconfig/etc/profile file to $HOME/.profile. I was hesitant about doing this.

anyways, i made a copy of the original .profile (renamed it as /tmp/.profile.orig), which is attached.

btw, since I have no network to that server (as I am in single-user mode), I am copying and pasting the contents of the file(s) into notepad and attaching here.

thanks!
Ravi.
Dennis Handly
Acclaimed Contributor

Re: ${HOME:-.}/.profile[22]: test: argument expected

>the analyst asked me to copy /usr/newconfig/etc/profile file

There are at least three "profile" files in /usr/newconfig. That one is for /etc/profile. There is one for root .profile and another for other users.

>I made a copy of the original .profile, which is attached.

Nothing obvious here. If you keep adding "set -x" to every .profile, you'll eventually find the one that is printing the error. :-)

It would be helpful to at least point out which lines are 22, 25 etc, to see if there is any pattern. They should have "[...]".