Operating System - HP-UX
1825002 Members
2650 Online
109678 Solutions
New Discussion юеВ

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

 
SOLVED
Go to solution
Grayh
Trusted Contributor

sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

I have some strange errors here... dont know if this has got something to do with the shell

$ sqlplus system/hp@HP01
sh: HP01: not found.

$ sqlplus system/hp @ HP01
\sh: HP01: not found.

$ sqlplus system/hp /@ HP01
sh: HP01: not found.

But when I give the below command it works
$ sqlplus system/hp

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Oct 1 11:42:28 2008

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit;
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 6
bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

And Again
$ sqlplus system/hp@HP01
sh: HP01: not found.

But again when I do a \ it again goes well
$ sqlplus system/hp\@HP01

SQL*Plus: Release 10.2.0.4.0 - Production on Wed Oct 1 11:43:26 2008

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

here also the same issue

SQL> conn system/hp@HP01
SP2-0042: unknown command "HP01" - rest of line ignored.

How can I rectify this.
24 REPLIES 24
Suraj K Sankari
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Hi,

Did you tried like this ./sh HP01 or give the full path of your program like ./sh /home/abc/HP01 if this also give same error then change your file name and try once again.

Note: If HP01 is having some unix command there also give the full path.

Suraj
Patrick Wallek
Honored Contributor
Solution

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

The problem is stty settings. By default the 'kill' character is the '@'. Kill, in this context, means wipe out everything on the line prior to the @.

So when you do 'sqlplus system/hp@HP01' the @ is telling the shell to wipe out 'sqlplus system/hp' and you are left with 'HP01' which is not a valid command.

When you insert the backslash before the @ ('sqlplus system/hp\@HP01') you are 'escaping' the '@' (telling the shell to ignore its special stty meaning) and the command behaves as you expect.

The solution is to set the stty 'kill' to something other than the '@'. I have mine set to CTRL-u.

To do this do:

$ stty kill ^u
(where ^u mean to hold down the CTRL key and then press u.)

$ man stty
should explain things.
OldSchool
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

at the terminal you are using run:

stty -a

you will probably see "kill = @" somewhere.

if so, you can change it to something else, like Cntrl-U (^U) or continue to use the backslash to escape the @, as in \@.

The "kill" character erases everything typed on a line up to and including the kill character itself.
Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Thanks partick and Old school....

I have done that and it worked...

but again every time I open a session I have to enter $stty kill ^u and then connect to sql

Is there a way to set this permently
Patrick Wallek
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

You should be able to set it in your .profile (assuming the /usr/bin/sh shell).
OldSchool
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

uh...yeah. if every user needs it, consider /etc/profile. if just one, then the users profile would be appropriate.

Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Is this the place where I need to make changes

# set term if it's not set

if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
-o "$TERM" = "network" ]
then
eval `ttytype -s -a`
fi

export TERM

# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
then
ERASE="^H"
export ERASE
fi
stty erase $ERASE
Pete Randall
Outstanding Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

I would look through your profile, find the last place where any stty settings are made and then change it after that point.


Pete

Pete
Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

is it at the root I have to make the changes or at the user "oracle"

Changing the below to

# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
then
ERASE="^H"
export ERASE
fi
stty erase $ERASE

# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
then
ERASE="^C"
export ERASE
fi
stty erase $ERASE

wq!
Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

I have tried to edit ttyconf file but it dosent allow me to do it...

I logged in as a user and su root
couldn't find anything in vi /etc/profile to change and vi /dev/ttyconf dosent allow me to change it...

so I was wondering where to add ^u

Either as a user su to root or directly login as root and modify them

but again where in /etc/profiles I should modify..

I am searching on google .. couldn't find anything
Pete Randall
Outstanding Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Here is what my /etc/profile contains for stty commands:

$ grep stty /etc/profile
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
stty susp ""
stty dsusp ""

You can either change the one that explicitly sets "kill" or you can place a new "stty kill" command anywhere after that. If there are no stty commands in your /etc/profile, check the user's own .profile. If there is an "stty kill" command in .profile, then that is where you would want to change it since .profile is usually read after /etc/profile.


Pete


Pete
Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

I have the following when I vi .profile


# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs

echo
echo "Value of TERM has been set to \"$TERM\". "

and I have this....

grep stty /etc/profile
stty erase $ERASE

and this...

# stty -a
speed 9600 baud; line = 0;
rows = 25; columns = 80
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp ; dsusp
werase ; lnext
parenb -parodd cs7 -cstopb hupcl -cread -clocal -loblk -crts
-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop tab3

now where to change....



OldSchool
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

that .profile appears to be correct. note that kill is no longer "@" in your output.

so whose profile is it, and can that user run "sqlplus system/hp@HP01" now without issues?


Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Thanks everyone

Issue resolved...

by replacing @ with ^U

Issue is resolved but looks like I have changed it as root...

$ echo "stty kill ^u" >> $HOME/.profile
$ grep stty /etc/profile
stty erase $ERASE

I still did not get kill ^U in the above o/p

but when I do stty -a I get the below

$ stty -a
speed 9600 baud; line = 0;
rows = 25; columns = 80
min = 4; time = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp ; dsusp
werase ; lnext
parenb -parodd cs7 -cstopb hupcl -cread -clocal -lob

Could you give me the exact steps as in like

login as oracle
then
$vi /etc/profile
.
.
.

Thank you in advance
OldSchool
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

"$ echo "stty kill ^u" >> $HOME/.profile
$ grep stty /etc/profile"
stty erase $ERASE

I still did not get kill ^U in the above o/p"

1) you put in in $HOME/.profile
2) you LOOKED for it in /etc/profile. Did you really expect THAT to work?
3) the "echo ...>> ...profile" stuff is deadly and should be avoided. one little typo and the profile is *gone* or nearly so. I'll leave you to figure out what that might be
4) if "stty -a" reports "kill = ^U" for all the users that need it, then you are good to go.
5) if you want to do it for everybody, add the line in /etc/profile. This has been noted on at least 2 prior occassions.
6) if you want it for just oracle, repeat the exercise of added 'stty kill "^U" to the .profile in oracle users home directory

note that all of the above rely on the user's default shell being sh or ksh or similar.

that being said, read the man pages associated with the shell(s) you are using, and the man page for "login" to get a handle on which files are read / executed and what order..........
Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

6) if you want it for just oracle, repeat the exercise of added 'stty kill "^U" to the .profile in oracle users home directory

Am I doing it right:-

Logged in as oracle

$pwd
/home/oracle
$vi /etc/profile

kill=^U

or

$vi .profile

kill=^U


Please advise...
Patrick Wallek
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

NO!

There should be a .profile file in /home/oracle. Make your change there is you want active only for the oracle user.

James R. Ferguson
Acclaimed Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Hi:

> $vi /etc/profile
> kill=^U
> or
> $vi .profile
> kill=^U
> Please advise...

As OldSchool has already said, *read* the manpages!

http://www.docs.hp.com/en/B2355-60130/sh-posix.1.html

If you want your change to apply to *all* users, edit '/etc/profile'. If you want your change to apply only to the 'oracle' users, change 'oracle's '${HOME}/.profile'.

Now, remember, the '/etc/profile' and '${HOME}/.profile' files apply only to the POSIX shell (the standard HP-UX shell found as '/sbin/sh' and as '/usr/bin/sh', or to the Korn shell (found as '/usr/bin/ksh'). These files are *not* sourced during the 'csh' nor 'bash' login sequences. But then, of course, you are using the POSIX shell :-)

Regards!

...JRF...
OldSchool
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

"kill=^U" isn't correct either, in EITHER file. That just creates a shell variable named "kill" with a value of ^U.

did you even bother to read the posts...the correct answers and instructions have been given multiple times now.

it is:

stty kill ^U

or

stty kill "^U"

Sooooo......once again

If you need it for everybody then:
a) log in or su to root
b) vi /etc/passwd
c) add the stty noted, after the last stty command that is in the file, something like this:

# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
then
ERASE="^H"
export ERASE
fi
stty erase $ERASE
stty kill "^U"

If you only want it for select users, like oracle, edit the .profile in the users home directory.
a) log in as root
b) cd
c) vi .profile
d) add the stty noted. MOST standard distributions have it there already, as in


if [ ! "$VUE" ]; then

# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D" susp ^Z
#stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs

echo
echo "Value of TERM has been set to \"$TERM\". "
export TERM

EDITOR=vi
export EDITOR

fi # if !VUE


Note Jame's warning about the shell being used. The changes will have to be made elsewhere if you are using something like "bash" or "csh".
Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.


If modifing $(home)/profile is correct then what i have given previsiouly should also be correct

login as oracle

$pwd
/home/oracle
$vi /$HOME/.profile
export ORACLE_BASE=/data/oracle
export ORACLE_SID=MAHP01
export PATH=$PATH:/usr/local/bin
export ORACLE_HOME=/data/oracle/oracle/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export TNS_ADMIN=$ORACLE_HOME/network/admin
kill=^U =====>ADD HERE

or may be

$echo "stty kill ^u" >> $HOME/.profile

$exit

a .profile or nothing is there after logged in as oracle

$ pwd
/home/oracle
$ ls
$ ll
total 0
$ cd ..
$ ll
total 0
drwxr-xr-x 2 gcameron is 96 Oct 1 16:34 gcameron
drwxr-xr-x 2 iwww other 96 Sep 30 11:18 iwww
drwxr-xr-x 2 root root 96 Sep 30 10:42 lost+found
drwxrwxrwx 3 root sys 96 Sep 30 19:26 oracle
drwxr-xr-x 2 owww other 96 Sep 30 11:18 owww
$ cd ..
$ ls
bin etc lost+found qc taxware var
data home net sbin tmp
dev lib opt stand usr
$ pwd
/
$

that is all I have when logged in as oracle

If you could tell me step by step like below please:-

log in as oracle
$vi to xxxxxx
add kill=^U

:wq!
$

thank you
Patrick Wallek
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

OK, so explain to us again how you managed to get this job when you apparently do not know the most basic HP-UX admin tasks?

1) When doing an 'ls' or 'll' as a normal user the dot files will be hidden. You must use 'ls -a' or 'll -a' to see ALL files.

2) If the .profile file doesn't exist, then a) the user wasn't created correctly, or b) it was created correctly but no .profile was created for some reason.

To create a .profile file, just use vi.

$ pwd
/home/oracle
$ vi .profile

Now just add whatever you need.

Note that you probably want some other information in Oracle's .profile besides just your stty commands. Things like the PATH to $ORACLE_HOME/bin, $ORACLE_SID to set the database name, and other various Oracle information.

Grayh
Trusted Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Thanks Patrick Wallek..
OldSchool
Honored Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Grayh:
"If modifing $(home)/profile is correct then what i have given previsiouly should also be correct"

You said:
kill=^U

Which ISN'T:
stty kill ^U
(which was my point.)

then you seem to fail to grasp you made a change one place and looked for said change in another, as in:

Grayh:
$ echo "stty kill ^u" >> $HOME/.profile
$ grep stty /etc/profile
stty erase $ERASE

Note the two different files in the above....

Then you posted this:

"I have the following when I vi .profile


# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs"

In which you will note the required setting is already there....

also "echo whatever >> ./profile" is deadly....but apparently you don't understand how that could be.

I also noted at least 7 times where you were given instructions on how to fix this... you do realize that this should have only taken a couple of minutes, not a couple of days, right?
Dennis Handly
Acclaimed Contributor

Re: sh: HP01: not found. & unknown command "HP01" - rest of line ignored.

Here are some more links on the problem and how to fix it with stty and not to make a permanent solution with /dev/ttyconf:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1217841
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=571070