What enables tab completion on default shell in 6.1

When a build an embedded system I do not get the file and directory name
tab-completion as I have on my development system. The shell on my embedded
system is started from the kernel image in following way:

[+session pri=10o]
PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are there any
other tricks needed?

Thanks
Jens

But which shell is it? Only /bin/ksh has the completion. It’s likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <jhj@remove-nospam-videk.com> wrote:

When a build an embedded system I do not get the file and directory name
tab-completion as I have on my development system. The shell on my embedded
system is started from the kernel image in following way:

[+session pri=10o]
PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are there any
other tricks needed?

Thanks
Jens




cburgess@qnx.com

It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still does not
work.

I just found this out: it might be something with the terminal setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <cburgess@qnx.com> wrote in message
news:b3daoa$jt0$2@nntp.qnx.com

But which shell is it? Only /bin/ksh has the completion. It’s likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and directory name
tab-completion as I have on my development system. The shell on my
embedded
system is started from the kernel image in following way:

[+session pri=10o]

PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com

I forgot to mention what the behavior in the console is.

When I hit the tab-key - a tab is shown console window.

Any idea Colin?


Jens



“Jens H Jorgensen” <jhj@remove-nospam-videk.com> wrote in message
news:b3dlgo$l2c$1@inn.qnx.com

It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still does not
work.

I just found this out: it might be something with the terminal setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:b3daoa$jt0$> 2@nntp.qnx.com> …
But which shell is it? Only /bin/ksh has the completion. It’s likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and directory
name
tab-completion as I have on my development system. The shell on my
embedded
system is started from the kernel image in following way:

[+session pri=10o]


PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are
there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com

bind ^i=complete

The default for command completion for ksh is .
If tab works, a line like the above must have been run
somewhere.

Do you log in the same way on the console? ie. is the
same .profile and .kshrc run?

-seanb

Jens H Jorgensen <jhj@remove-nospam-videk.com> wrote:

I forgot to mention what the behavior in the console is.

When I hit the tab-key - a tab is shown console window.

Any idea Colin?


Jens



“Jens H Jorgensen” <> jhj@remove-nospam-videk.com> > wrote in message
news:b3dlgo$l2c$> 1@inn.qnx.com> …
It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still does not
work.

I just found this out: it might be something with the terminal setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:b3daoa$jt0$> 2@nntp.qnx.com> …
But which shell is it? Only /bin/ksh has the completion. It’s likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and directory
name
tab-completion as I have on my development system. The shell on my
embedded
system is started from the kernel image in following way:

[+session pri=10o]


PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are
there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com

On the console the shell is run directly from the kernel image(see below)
with no login, whereas through telnet I guess it is started by telnetd.

Where would the bind ^i=complete be?

Thanks
Jens



“Sean Boudreau” <seanb@node25.ott.qnx.com> wrote in message
news:b3dmsg$s7d$1@nntp.qnx.com

bind ^i=complete

The default for command completion for ksh is .
If tab works, a line like the above must have been run
somewhere.

Do you log in the same way on the console? ie. is the
same .profile and .kshrc run?

-seanb

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
I forgot to mention what the behavior in the console is.

When I hit the tab-key - a tab is shown console window.

Any idea Colin?


Jens



“Jens H Jorgensen” <> jhj@remove-nospam-videk.com> > wrote in message
news:b3dlgo$l2c$> 1@inn.qnx.com> …
It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still does
not
work.

I just found this out: it might be something with the terminal setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:b3daoa$jt0$> 2@nntp.qnx.com> …
But which shell is it? Only /bin/ksh has the completion. It’s
likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and directory
name
tab-completion as I have on my development system. The shell on my
embedded
system is started from the kernel image in following way:

[+session pri=10o]



PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are
there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com
\

Usually in your ~/.profile there is a line like:
EXPORT ENV=$HOME/.kshrc

And in your ~/.kshrc something like:

case $- in
i)
bind ^i=complete
esac

Jens H Jorgensen <jhj@remove-nospam-videk.com> wrote:

On the console the shell is run directly from the kernel image(see below)
with no login, whereas through telnet I guess it is started by telnetd.

Where would the bind ^i=complete be?

Thanks
Jens



“Sean Boudreau” <> seanb@node25.ott.qnx.com> > wrote in message
news:b3dmsg$s7d$> 1@nntp.qnx.com> …

bind ^i=complete

The default for command completion for ksh is .
If tab works, a line like the above must have been run
somewhere.

Do you log in the same way on the console? ie. is the
same .profile and .kshrc run?

-seanb

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
I forgot to mention what the behavior in the console is.

When I hit the tab-key - a tab is shown console window.

Any idea Colin?


Jens



“Jens H Jorgensen” <> jhj@remove-nospam-videk.com> > wrote in message
news:b3dlgo$l2c$> 1@inn.qnx.com> …
It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still does
not
work.

I just found this out: it might be something with the terminal setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:b3daoa$jt0$> 2@nntp.qnx.com> …
But which shell is it? Only /bin/ksh has the completion. It’s
likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and directory
name
tab-completion as I have on my development system. The shell on my
embedded
system is started from the kernel image in following way:

[+session pri=10o]



PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are
there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com
\

Or in your case, maybe try something like:

PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x86/usr/sbin/:/usr/bin:. ENV=/home/root/.kshrc sh &

And fill in the /home/root/.kshrc as below.

-seanb

Usually in your ~/.profile there is a line like:
EXPORT ENV=$HOME/.kshrc

And in your ~/.kshrc something like:

case $- in
i)
bind ^i=complete
esac

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
On the console the shell is run directly from the kernel image(see below)
with no login, whereas through telnet I guess it is started by telnetd.

Where would the bind ^i=complete be?

Thanks
Jens



“Sean Boudreau” <> seanb@node25.ott.qnx.com> > wrote in message
news:b3dmsg$s7d$> 1@nntp.qnx.com> …

bind ^i=complete

The default for command completion for ksh is .
If tab works, a line like the above must have been run
somewhere.

Do you log in the same way on the console? ie. is the
same .profile and .kshrc run?

-seanb

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
I forgot to mention what the behavior in the console is.

When I hit the tab-key - a tab is shown console window.

Any idea Colin?


Jens



“Jens H Jorgensen” <> jhj@remove-nospam-videk.com> > wrote in message
news:b3dlgo$l2c$> 1@inn.qnx.com> …
It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still does
not
work.

I just found this out: it might be something with the terminal setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:b3daoa$jt0$> 2@nntp.qnx.com> …
But which shell is it? Only /bin/ksh has the completion. It’s
likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and directory
name
tab-completion as I have on my development system. The shell on my
embedded
system is started from the kernel image in following way:

[+session pri=10o]



PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also are
there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com
\

Jens H Jorgensen <jhj@remove-nospam-videk.com> wrote:

On the console the shell is run directly from the kernel image(see below)

sounds like it is a “bug” with the kernel image :slight_smile: it doesn’t
honor your /etc/profile or .profile.
Maybe at that time, kernel images can’t see filesystem yet?

at the prompt, just type
… /etc/profile
you will have your tab completion back.

Frank

Yes - that is it, it does not execute the /etc/profile.

Jens



“liug” <liug@mama.indstate.edu> wrote in message
news:b3dpao$ooa$2@inn.qnx.com

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
On the console the shell is run directly from the kernel image(see
below)

sounds like it is a “bug” with the kernel image > :slight_smile: > it doesn’t
honor your /etc/profile or .profile.
Maybe at that time, kernel images can’t see filesystem yet?

at the prompt, just type
. /etc/profile
you will have your tab completion back.

Frank

Thanks got it.

Jens

“Sean Boudreau” <seanb@node25.ott.qnx.com> wrote in message
news:b3dopt$hc$1@nntp.qnx.com

Or in your case, maybe try something like:


PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x

86/usr/sbin/:/usr/bin:. ENV=/home/root/.kshrc sh &

And fill in the /home/root/.kshrc as below.

-seanb

Usually in your ~/.profile there is a line like:
EXPORT ENV=$HOME/.kshrc

And in your ~/.kshrc something like:

case $- in
i)
bind ^i=complete
esac

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
On the console the shell is run directly from the kernel image(see
below)
with no login, whereas through telnet I guess it is started by telnetd.

Where would the bind ^i=complete be?

Thanks
Jens



“Sean Boudreau” <> seanb@node25.ott.qnx.com> > wrote in message
news:b3dmsg$s7d$> 1@nntp.qnx.com> …

bind ^i=complete

The default for command completion for ksh is .
If tab works, a line like the above must have been run
somewhere.

Do you log in the same way on the console? ie. is the
same .profile and .kshrc run?

-seanb

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
I forgot to mention what the behavior in the console is.

When I hit the tab-key - a tab is shown console window.

Any idea Colin?


Jens



“Jens H Jorgensen” <> jhj@remove-nospam-videk.com> > wrote in message
news:b3dlgo$l2c$> 1@inn.qnx.com> …
It is ksh: below is a “ls -al sh”

ls -al sh

lrwxrwxrwx 1 root root 3 Sep 24 05:58 sh → ksh

and even if explicitly starts /bin/ksh - the tab-completion still
does
not
work.

I just found this out: it might be something with the terminal
setup,
because if I telnet into the embedded system tab-completion
works - whereas it doesn’t on any of the console’s.


Jens

“Colin Burgess” <> cburgess@qnx.com> > wrote in message
news:b3daoa$jt0$> 2@nntp.qnx.com> …
But which shell is it? Only /bin/ksh has the completion. It’s
likely
that you are using esh, which is a much simpler shell.

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
When a build an embedded system I do not get the file and
directory
name
tab-completion as I have on my development system. The shell on
my
embedded
system is started from the kernel image in following way:

[+session pri=10o]




PATH=/bin/:/proc/boot:/sbin/:/usr/sbin:/x86/bin/:/x86/sbin/:/x86/usr/bin/:/x
86/usr/sbin/:/usr/bin:. sh &

Is it the right shell to start to get tab-completion and also
are
there
any
other tricks needed?

Thanks
Jens





\

cburgess@qnx.com


\

A shell only executes those if it is a ‘login’ shell:
ie. argv[0][0] == ‘-’.

[argv0=-sh] PATH= sh

-seanb

Jens H Jorgensen <jhj@remove-nospam-videk.com> wrote:

Yes - that is it, it does not execute the /etc/profile.

Jens



“liug” <> liug@mama.indstate.edu> > wrote in message
news:b3dpao$ooa$> 2@inn.qnx.com> …
Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
On the console the shell is run directly from the kernel image(see
below)

sounds like it is a “bug” with the kernel image > :slight_smile: > it doesn’t
honor your /etc/profile or .profile.
Maybe at that time, kernel images can’t see filesystem yet?

at the prompt, just type
. /etc/profile
you will have your tab completion back.

Frank

liug <liug@mama.indstate.edu> wrote:

Jens H Jorgensen <> jhj@remove-nospam-videk.com> > wrote:
On the console the shell is run directly from the kernel image(see below)

sounds like it is a “bug” with the kernel image > :slight_smile: > it doesn’t
honor your /etc/profile or .profile.
Maybe at that time, kernel images can’t see filesystem yet?

No, it isn’t a bug. It is normal expected shell initialization behaviour.

Shell initialization rules:

If the shell is a login shell – i.e. if argv[0][0] == ‘-’ – then
the shell will look for /etc/profile and will interpret the commands
there if the file exists (and is readable)
the shell will look for $HOME/.profile and will interpret the commands
there if the file exists (and is readable)
For all shells, the shell will check if the ENV environment variable is
set, if so, and if the file $ENV exists and is readable, the shell
will interpret the commands there. (Traditionally this file is
called $HOME/.rc, e.g. $HOME/.kshrc or $HOME/.shrc .)

(The above is the case for bourne/korn shells (ksh which is pdksh, a
public-domain implementation of the korn shell). For other shells,
e.g. itcsh, csh, esh, fesh, the rules may be different.)

What this means: environment variables are inherited, other settings
(such as aliases, key-bindings) are not. You should put environment
variable settings in the .profile, other aliases and commands into
the $ENV file. That way, if you start a sub-shell, you will still get
those settings.

Some things you could do:
– try and force the shell to be a login shell. I don’t think there
is any way to specify the argv[0] for stuff started in the boot script,
but you could write a small starter program in C that does this manipulation
for you. Or, put a (procmgr) symlink from -ksh to /bin/ksh somewhere that
is in the search path.

– login properly
– export ENV and any other environment variables before running the
shell, e.g. [+session] ENV=/home/root/.kshrc /bin/ksh
– manually source (read in and interpret) your profile, e.g.:

at the prompt, just type
. /etc/profile

-David

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

“David Gibbs” <dagibbs@qnx.com> wrote in message
news:b3e63j$95d$1@nntp.qnx.com

Some things you could do:
– try and force the shell to be a login shell. I don’t think there
is any way to specify the argv[0] for stuff started in the boot script,
but you could write a small starter program in C that does this
manipulation
for you. Or, put a (procmgr) symlink from -ksh to /bin/ksh somewhere that
is in the search path.

What about ‘ksh -l’?

Kris Warkentin <kewarken@qnx.com> wrote:

“David Gibbs” <> dagibbs@qnx.com> > wrote in message
news:b3e63j$95d$> 1@nntp.qnx.com> …
Some things you could do:
– try and force the shell to be a login shell. I don’t think there
is any way to specify the argv[0] for stuff started in the boot script,
but you could write a small starter program in C that does this
manipulation
for you. Or, put a (procmgr) symlink from -ksh to /bin/ksh somewhere that
is in the search path.

What about ‘ksh -l’?

Doh.

ksh didn’t use to have a ‘-l’ option. Guess it does now, and that
would solve it.

-David

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