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

${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
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 "[...]".
Bill Hassell
Honored Contributor

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

>> it never starts any services

Do you mean that the startup scripts do not run? What does /etc/rc.log show? Did you recently cd to the /etc/rc.config.d directory and edit some files? Check like this:

ls -lart /etc/rc.config.d | tail

There can never be any junk files in this directory or your system may be unable to boot into a normal mode.


Bill Hassell, sysadmin
Ravi S. Banda
Regular Advisor

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

Since the last reboot (21-Apr-2010), I saw a file pointer under /sbin/rc3.d

lrwxrwxr-x 1 root sys 23 May 14 08:05 K98gcstartup -> /sbin//init.d/gcstartup
lrwxrwxr-x 1 root sys 23 May 14 08:05 S98gcstartup -> /sbin//init.d/gcstartup

I went to /sbin/init.d; moved the file gcstartup to /tmp directory.

gcstartup is associated with Oracleâ s crs/gc setup, created by Oracle, not by me.

Rebooted the server â everything seems to be fine.
Iâ m still thinking whether I should give it a try by moving gcstartup file in /sbin/init.d directory â and see if it fails again to reboot.

Our ignite backups are run/overwritten once a day â so, the backups would have been overwritten onto the DDS tape â because when the server was up and running, nothing seemed wrong.

Thanks!
Ravi.
Patrick Wallek
Honored Contributor

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

What happens now if you run the 'gcstartup' script manually?
Ravi S. Banda
Regular Advisor

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



good point!

gcstartup contains the line at the end (not modified by me) to startup Oracle Agent 10g:

if [ -f /apps/tstc/oracle/agent10g/install/unix/scripts/agentstup ]; then
/bin/su - oracle -c "/apps/tstc/oracle/agent10g/install/unix/scripts/agentstup $1"
fi

gcstartup, when run, prompts me to choose the database instance - because we have multiple database instances for the UNIX user 'oracle'; it validates which option we choose - if we don't choose any option or press enter, it would say:

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

well, that explains it!!!


Thanks!
Ravi.
Ravi S. Banda
Regular Advisor

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

i will assign the points and close this thread.
Ravi S. Banda
Regular Advisor

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

Points assigned!
Dennis Handly
Acclaimed Contributor

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

>I went to /sbin/init.d; moved the file gcstartup to /tmp directory.

In general, what's in there is ignored and it is just a place to hold all of the rc scripts. It is the presence of the symlinks in /sbin/rc?.d/ that do the actual work.