Where does $PATH get set?

I’m brand new to QNX and am having a bit of trouble…

We have a machine that I am trying to install a network card for the first
time. I purchased the TCP/IP license and installed the TCP/IP package.
That seemed to go fine. The problem is that none of the executables show up
in my $PATH.

Currently echo $PATH gives:
/bin:/etc/:/usr/bin

I found that all the tcp/ip related binaries (telnet, ftp, etc…) are in
/usr/ucb which as you can see is not in my path. I’m coming to QNX from a
Linux background and I found that there is an /etc/profile file. If I look
at that file, the first line says:
export PATH=$PATH:/usr/ucb:/usr/local/bin TMPDIR=${TMPDIR:-/tmp}

Obviously it appears that the line in the profile is never getting executed,
or something is setting the path afterwords. Can someone point me in the
right direction for getting my PATH properly set?

Thanks,
Sean

Look at the documentation for “sh”, under “Initialization Files”.
/etc/profile gets executed by every shell that starts, followed by
$HOME/.profile, which is in your home directory (note that this is
dot-profile).

“Sean Murphy” <sean.murphy@veridian.com> wrote in message
news:b8ovfq$lrc$1@nntp.qnx.com

I’m brand new to QNX and am having a bit of trouble…

We have a machine that I am trying to install a network card for the first
time. I purchased the TCP/IP license and installed the TCP/IP package.
That seemed to go fine. The problem is that none of the executables show
up
in my $PATH.

Currently echo $PATH gives:
/bin:/etc/:/usr/bin

I found that all the tcp/ip related binaries (telnet, ftp, etc…) are in
/usr/ucb which as you can see is not in my path. I’m coming to QNX from a
Linux background and I found that there is an /etc/profile file. If I
look
at that file, the first line says:
export PATH=$PATH:/usr/ucb:/usr/local/bin TMPDIR=${TMPDIR:-/tmp}

Obviously it appears that the line in the profile is never getting
executed,
or something is setting the path afterwords. Can someone point me in the
right direction for getting my PATH properly set?

Thanks,
Sean

I forgot to mention I’m on QNX 4.25, and we have the machine set up with no
users (not sure if this is the correct term or not, what I mean is that when
you boot the machine, you get right to a # prompt without having to log in).

Once at the # prompt, a ‘pwd’ says I’m in //1/, and an ‘ls’ shows no
…profile directory. Typing ‘cd ~’ takes me to this same location.

I added a .profile file in that location with the line ‘export
PATH=$PATH:/usr/ucb’ but with no effect.

Sean

“Kevin Miller” <kevin.miller@transcore.com> wrote in message
news:b8p1nd$ng0$1@nntp.qnx.com

Look at the documentation for “sh”, under “Initialization Files”.
/etc/profile gets executed by every shell that starts, followed by
$HOME/.profile, which is in your home directory (note that this is
dot-profile).

“Sean Murphy” <> sean.murphy@veridian.com> > wrote in message
news:b8ovfq$lrc$> 1@nntp.qnx.com> …
I’m brand new to QNX and am having a bit of trouble…

We have a machine that I am trying to install a network card for the
first
time. I purchased the TCP/IP license and installed the TCP/IP package.
That seemed to go fine. The problem is that none of the executables
show
up
in my $PATH.

Currently echo $PATH gives:
/bin:/etc/:/usr/bin

I found that all the tcp/ip related binaries (telnet, ftp, etc…) are
in
/usr/ucb which as you can see is not in my path. I’m coming to QNX from
a
Linux background and I found that there is an /etc/profile file. If I
look
at that file, the first line says:
export PATH=$PATH:/usr/ucb:/usr/local/bin TMPDIR=${TMPDIR:-/tmp}

Obviously it appears that the line in the profile is never getting
executed,
or something is setting the path afterwords. Can someone point me in
the
right direction for getting my PATH properly set?

Thanks,
Sean
\

Sean Murphy wrote:

I forgot to mention I’m on QNX 4.25, and we have the machine set up with no
users (not sure if this is the correct term or not, what I mean is that when
you boot the machine, you get right to a # prompt without having to log in).

As I recall it’s a login process that reads /etc/profile and from your
description, you never hit that. The simplest thing to do would be to
add the full PATH somewhere before the TCP/IP startup in
/etc/config/sysinit.1. In case you didn’t notice, there is a acript
/etc/netstart which you may want to fire up from sysinit as well.

Richard

Once at the # prompt, a ‘pwd’ says I’m in //1/, and an ‘ls’ shows no
.profile directory. Typing ‘cd ~’ takes me to this same location.

I added a .profile file in that location with the line ‘export
PATH=$PATH:/usr/ucb’ but with no effect.

Sean

“Kevin Miller” <> kevin.miller@transcore.com> > wrote in message
news:b8p1nd$ng0$> 1@nntp.qnx.com> …

Look at the documentation for “sh”, under “Initialization Files”.
/etc/profile gets executed by every shell that starts, followed by
$HOME/.profile, which is in your home directory (note that this is
dot-profile).

“Sean Murphy” <> sean.murphy@veridian.com> > wrote in message
news:b8ovfq$lrc$> 1@nntp.qnx.com> …

I’m brand new to QNX and am having a bit of trouble…

We have a machine that I am trying to install a network card for the

first

time. I purchased the TCP/IP license and installed the TCP/IP package.
That seemed to go fine. The problem is that none of the executables

show

up

in my $PATH.

Currently echo $PATH gives:
/bin:/etc/:/usr/bin

I found that all the tcp/ip related binaries (telnet, ftp, etc…) are

in

/usr/ucb which as you can see is not in my path. I’m coming to QNX from

a

Linux background and I found that there is an /etc/profile file. If I

look

at that file, the first line says:
export PATH=$PATH:/usr/ucb:/usr/local/bin TMPDIR=${TMPDIR:-/tmp}

Obviously it appears that the line in the profile is never getting

executed,

or something is setting the path afterwords. Can someone point me in

the

right direction for getting my PATH properly set?

Thanks,
Sean


\

If you never log in to this system then there are only two other places
to set export variables (i.e. PATH).

They could be set in the build file on the ‘sinit’ line (rarely a good
choice, but a possibility). The other (and better place in my opinion)
is to put them into your “/etc/config/sysinit.<node_number>” file.


Sean Murphy <sean.murphy@veridian.com> wrote:
SM > I forgot to mention I’m on QNX 4.25, and we have the machine set up with no
SM > users (not sure if this is the correct term or not, what I mean is that when
SM > you boot the machine, you get right to a # prompt without having to log in).

SM > Once at the # prompt, a ‘pwd’ says I’m in //1/, and an ‘ls’ shows no
SM > .profile directory. Typing ‘cd ~’ takes me to this same location.

SM > I added a .profile file in that location with the line ‘export
SM > PATH=$PATH:/usr/ucb’ but with no effect.

SM > Sean

SM > “Kevin Miller” <kevin.miller@transcore.com> wrote in message
SM > news:b8p1nd$ng0$1@nntp.qnx.com

Look at the documentation for “sh”, under “Initialization Files”.
/etc/profile gets executed by every shell that starts, followed by
$HOME/.profile, which is in your home directory (note that this is
dot-profile).

“Sean Murphy” <> sean.murphy@veridian.com> > wrote in message
news:b8ovfq$lrc$> 1@nntp.qnx.com> …
I’m brand new to QNX and am having a bit of trouble…

We have a machine that I am trying to install a network card for the
SM > first
time. I purchased the TCP/IP license and installed the TCP/IP package.
That seemed to go fine. The problem is that none of the executables
SM > show
up
in my $PATH.

Currently echo $PATH gives:
/bin:/etc/:/usr/bin

I found that all the tcp/ip related binaries (telnet, ftp, etc…) are
SM > in
/usr/ucb which as you can see is not in my path. I’m coming to QNX from
SM > a
Linux background and I found that there is an /etc/profile file. If I
look
at that file, the first line says:
export PATH=$PATH:/usr/ucb:/usr/local/bin TMPDIR=${TMPDIR:-/tmp}

Obviously it appears that the line in the profile is never getting
executed,
or something is setting the path afterwords. Can someone point me in
SM > the
right direction for getting my PATH properly set?

Thanks,
Sean

\


Bill Caroselli – Q-TPS Consulting
1-(626) 824-7983
qtps@earthlink.net

Ok, I tried putting the line:
“export PATH=$PATH:/usr/ucb”
in my /etc/config/sysinit.1 file and there was no change. Upon restart
“echo $PATH” gives:
/bin:/etc:/usr/bin
I put the export line as the last line of sysinit.1 and there is a newline
after it.

If whoever set the machine up had used the ‘sinit’ line in the build file to
set the path, would it overwrite what I’m trying to do in the sysinit.1
file? Like if they had in there just PATH=/bin:/etc:/usr/bin that would
clobber what I’m trying to add if that occurs after the sysinit.1 file is
parsed. I would assume though that the sysinit.1 file is read after all the
stuff in the built image is done.

Sean

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:b8pk9d$40o$3@inn.qnx.com

If you never log in to this system then there are only two other places
to set export variables (i.e. PATH).

They could be set in the build file on the ‘sinit’ line (rarely a good
choice, but a possibility). The other (and better place in my opinion)
is to put them into your “/etc/config/sysinit.<node_number>” file.


Sean Murphy <> sean.murphy@veridian.com> > wrote:
SM > I forgot to mention I’m on QNX 4.25, and we have the machine set up
with no
SM > users (not sure if this is the correct term or not, what I mean is
that when
SM > you boot the machine, you get right to a # prompt without having to
log in).

SM > Once at the # prompt, a ‘pwd’ says I’m in //1/, and an ‘ls’ shows no
SM > .profile directory. Typing ‘cd ~’ takes me to this same location.

SM > I added a .profile file in that location with the line ‘export
SM > PATH=$PATH:/usr/ucb’ but with no effect.

SM > Sean

SM > “Kevin Miller” <> kevin.miller@transcore.com> > wrote in message
SM > news:b8p1nd$ng0$> 1@nntp.qnx.com> …
Look at the documentation for “sh”, under “Initialization Files”.
/etc/profile gets executed by every shell that starts, followed by
$HOME/.profile, which is in your home directory (note that this is
dot-profile).

“Sean Murphy” <> sean.murphy@veridian.com> > wrote in message
news:b8ovfq$lrc$> 1@nntp.qnx.com> …
I’m brand new to QNX and am having a bit of trouble…

We have a machine that I am trying to install a network card for the
SM > first
time. I purchased the TCP/IP license and installed the TCP/IP
package.
That seemed to go fine. The problem is that none of the executables
SM > show
up
in my $PATH.

Currently echo $PATH gives:
/bin:/etc/:/usr/bin

I found that all the tcp/ip related binaries (telnet, ftp, etc…)
are
SM > in
/usr/ucb which as you can see is not in my path. I’m coming to QNX
from
SM > a
Linux background and I found that there is an /etc/profile file. If
I
look
at that file, the first line says:
export PATH=$PATH:/usr/ucb:/usr/local/bin TMPDIR=${TMPDIR:-/tmp}

Obviously it appears that the line in the profile is never getting
executed,
or something is setting the path afterwords. Can someone point me in
SM > the
right direction for getting my PATH properly set?

Thanks,
Sean






\

Bill Caroselli – Q-TPS Consulting
1-(626) 824-7983
qtps@earthlink.net

Sean Murphy <sean.murphy@veridian.com> wrote:

Ok, I tried putting the line:
“export PATH=$PATH:/usr/ucb”
in my /etc/config/sysinit.1 file and there was no change. Upon restart
“echo $PATH” gives:
/bin:/etc:/usr/bin
I put the export line as the last line of sysinit.1 and there is a newline
after it.

You need it before you invoke tinit in the sysinit.

Basically, PATH is an environment variable, and is inherited by
everything started after you set it.

If you set it at the end of the sysinit, nothing will inherit it, but
if you set it before you start off other things (especially tinit or
any shells), thouse things will inherit it.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.

Bingo! That was definitely the problem. Thanks for your help.

Sean
“David Gibbs” <dagibbs@qnx.com> wrote in message
news:b8rlv1$g0i$1@nntp.qnx.com

Sean Murphy <> sean.murphy@veridian.com> > wrote:
Ok, I tried putting the line:
“export PATH=$PATH:/usr/ucb”
in my /etc/config/sysinit.1 file and there was no change. Upon restart
“echo $PATH” gives:
/bin:/etc:/usr/bin
I put the export line as the last line of sysinit.1 and there is a
newline
after it.

You need it before you invoke tinit in the sysinit.

Basically, PATH is an environment variable, and is inherited by
everything started after you set it.

If you set it at the end of the sysinit, nothing will inherit it, but
if you set it before you start off other things (especially tinit or
any shells), thouse things will inherit it.

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.