Modify Shell in Minix

Modify Shell in Minix

Post by Anku » Sat, 19 Apr 2003 01:14:48



Hi! If i want to modify the shell in minix to add tab command
completion, command history ect, which files would i be modifying and
also, once i have successfuly modified the files, if i compile with
make fdboot, would the shell be modified in the new kernel, or i would
have to seperately compile and put it on the floppy??

it would be great if someone would help me find some implementation of
command completion, command history in any shell??  or give me some
pointers on this.

thanx a ton.
-A

 
 
 

Modify Shell in Minix

Post by PS » Sun, 20 Apr 2003 05:13:41


Why don't you use ash shell (default for bin user)?

Regards,
Piotr "kocio" Matusz

 
 
 

Modify Shell in Minix

Post by Kees J B » Sun, 20 Apr 2003 19:11:41



>Why don't you use ash shell (default for bin user)?

It'll give you filename completion and a history, but what was asked for
is command completion.  This is where typing TAB after the first few
characters on the command line causes the shell to search around in
$PATH for commands that start with those letters.

Ash doesn't have this, or more precisely, the editline(3) library
doesn't have this.  Won't be easy to add, because if you do it right
then command completion should also work on 'ls;ch', i.e. after a
command separator like ; or && or | ...  You'd have to make editline
parse shell syntax, or work line editing back into the shell.

Don't anyone look at me, I don't even like command completion.  I want
TAB to have the same effect everywhere on the command line.
--
Kees J. Bot, Systems Programmer, Sciences dept., Vrije Universiteit Amsterdam

 
 
 

Modify Shell in Minix

Post by Anku » Mon, 21 Apr 2003 05:48:16


I understand that i can login as bin and everything will work, but i
have to do this cuz someone has asked me to help him out with this..it
would be great if u could tell me where i could find the source for
ash or any other place where this command completion is implemented
and also if someone could tell me
how exactly the shell flows, i mean when i start the shell then from
main where does it go where it reads all the chars in till enter and
then executes it..it would be really helpful..
thanx a ton

Ankur



> >Why don't you use ash shell (default for bin user)?

> It'll give you filename completion and a history, but what was asked for
> is command completion.  This is where typing TAB after the first few
> characters on the command line causes the shell to search around in
> $PATH for commands that start with those letters.

> Ash doesn't have this, or more precisely, the editline(3) library
> doesn't have this.  Won't be easy to add, because if you do it right
> then command completion should also work on 'ls;ch', i.e. after a
> command separator like ; or && or | ...  You'd have to make editline
> parse shell syntax, or work line editing back into the shell.

> Don't anyone look at me, I don't even like command completion.  I want
> TAB to have the same effect everywhere on the command line.

 
 
 

Modify Shell in Minix

Post by Kees J B » Mon, 21 Apr 2003 19:06:50




>I understand that i can login as bin and everything will work, but i
>have to do this cuz someone has asked me to help him out with this..it
>would be great if u could tell me where i could find the source for
>ash or any other place where this command completion is implemented

The source of ash is in /usr/src/commands/ash/ in an installation that
has CMD.TAZ.  Look around for READLINE in the code, that's the switch
that enables line editing.

Quote:>and also if someone could tell me
>how exactly the shell flows, i mean when i start the shell then from
>main where does it go where it reads all the chars in till enter and
>then executes it..it would be really helpful..

I'm afraid I can't be of help here.  I may have added the readline
support and a few other things to ash, but I didn't learn much about
it.  I just went after the PS1 and PS2 prompts, where they were printed,
and added readline calls where lines were read.

You don't always have to understand code to the last line to make a few
simple changes.

(I wonder who this "u" is you're talking to.)
--
Kees J. Bot, Systems Programmer, Sciences dept., Vrije Universiteit Amsterdam

 
 
 

Modify Shell in Minix

Post by Anku » Tue, 22 Apr 2003 14:12:43


Thanx i will take a look at this point tom. I need to get this done
urgently and fast. and yeah I refer to "u" as anyone reading the post.

Thanks again..it was helpful

Ankur




> >I understand that i can login as bin and everything will work, but i
> >have to do this cuz someone has asked me to help him out with this..it
> >would be great if u could tell me where i could find the source for
> >ash or any other place where this command completion is implemented

> The source of ash is in /usr/src/commands/ash/ in an installation that
> has CMD.TAZ.  Look around for READLINE in the code, that's the switch
> that enables line editing.

> >and also if someone could tell me
> >how exactly the shell flows, i mean when i start the shell then from
> >main where does it go where it reads all the chars in till enter and
> >then executes it..it would be really helpful..

> I'm afraid I can't be of help here.  I may have added the readline
> support and a few other things to ash, but I didn't learn much about
> it.  I just went after the PS1 and PS2 prompts, where they were printed,
> and added readline calls where lines were read.

> You don't always have to understand code to the last line to make a few
> simple changes.

> (I wonder who this "u" is you're talking to.)

 
 
 

Modify Shell in Minix

Post by wkt_at_tuhs... » Tue, 22 Apr 2003 16:34:55




Quote:> Hi! If i want to modify the shell in minix to add tab command
> completion, command history ect, which files would i be modifying and
> also, once i have successfuly modified the files, if i compile with
> make fdboot, would the shell be modified in the new kernel, or i would
> have to seperately compile and put it on the floppy??

Have a look at the wish shell, which is a shell I wrote for Minix and other
system to do aliases, command-line editing and history completion. It is
based on the Clam shell by Calum Gibson.

The early versions were also based on the shell in Marc Rochkind's book
``Advanced UNIX Programming''. While now dated, this is still a
great book to learn about the operations of a shell.

ftp://minnie.tuhs.org/pub/Wish/

Warren

 
 
 

Modify Shell in Minix

Post by Warren Toom » Tue, 22 Apr 2003 22:54:47






>> Hi! If i want to modify the shell in minix to add tab command
>> completion,  ...
> Have a look at the wish shell, which is a shell I wrote for Minix  ...
> ftp://minnie.tuhs.org/pub/Wish/

I realised that the last version at this URL was version 30, but I had
developed up to version 41. I have dug version 41 out, which has much
more documentation and a manual too. So, if you only saw v30, please
go back and look at v41 and the documentation.

        Warren

 
 
 

Modify Shell in Minix

Post by Anku » Wed, 23 Apr 2003 05:51:25


Thanks a ton,
this was quite helpful, i have not been able to really look deep into
the code cuz i am still at work, but when i get home i will. but
whatever i looked at was helpful.

I have one small query, if anyone knows anything about sh in minix. as
to where does the char get added to the command line buffer? Also
where does the sh loop to wait for chars till it receives a \n.

One more small question is..in ash they have implemented command
history and completion, but i have tried to look into the code and
havent found the place. So does anyone know where should i look for it
and also if these features are actually implemented in the c code?

thanx a ton.

Ankur






> >> Hi! If i want to modify the shell in minix to add tab command
> >> completion,  ...

> > Have a look at the wish shell, which is a shell I wrote for Minix  ...
> > ftp://minnie.tuhs.org/pub/Wish/

> I realised that the last version at this URL was version 30, but I had
> developed up to version 41. I have dug version 41 out, which has much
> more documentation and a manual too. So, if you only saw v30, please
> go back and look at v41 and the documentation.

>    Warren

 
 
 

1. How to modify Add-Ins in Excel 97 ?

I changed to Excel 97 and want to modify an Add-In, that was created with
Excel 95. But I can't find a way to compile a VBA-Macro to an Add-In. Does
anybody know how to create or modify Add-In's in Excel 97 ?

Thanks in advance,
Claudia Traunfellner

---------------

2. SAMBA digest 1020

3. Modifying DllRegisterServer and DllUnregisterServer in VB6 when writing shell extension

4. How to connect a modem to a Cisco 500-CS

5. Modifying Minix to do memory swapping

6. Problem with sending mail

7. Modifying Minix to support vfork()

8. Error when linking from Access 2000

9. Source for fsck modified to run under Minix.

10. modifying MINIX scheduler

11. Building a simple shell for MINIX

12. shell in minix

13. rc shell for Minix