Help ! Creatin own shell

  • holy007lotus
  • Novice
  • Novice
  • holy007lotus
  • Posts: 22
  • Loc: Jalandhar, India

Post 3+ Months Ago

I want to create my own shell in fedora core 4... can anybody guide me through all this.... what im supposed to know to make it possible.... I have gone through shell scripting and system administration topics in linux n quite familier with linux commands. Tell me how i can give it a start..
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

I don't understand the question; what do you mean "create your own shell"?

You want to code up a bash or tcsh alternative?
  • holy007lotus
  • Novice
  • Novice
  • holy007lotus
  • Posts: 22
  • Loc: Jalandhar, India

Post 3+ Months Ago

i want to create my own bash shell... tell me is it possible and which tools do i need for this.....
  • meman
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3432
  • Loc: London Town , Apples and pears and all that crap

Post 3+ Months Ago

He means specifically what you mean, rather than just repeating what you first said..

Are you talking about getting a remote shell on another machine? Or setting up a user account on your machine that people can log into?
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

holy007lotus wrote:
i want to create my own bash shell...

ha ha, I think you must be confused...
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

humbletech99 wrote:
ha ha, I think you must be confused...


Let's be nice and not pick on people. Remember, English may not be this person's first language.
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

ok, holy007lotus, first off, every user on a linux system has the bash shell just by having a user account unless the administrator has changed this default behaviour, so all you need to do is log in via tty, ssh or X(then use xterm).

The only program you need is, well, Bash - no surprise there I guess , see /bin/bash.

If you want to customize bits then use the files ~/.bashrc or other ~/.bash* files.
  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1853

Post 3+ Months Ago

holy7lotus, do you want to code a shell in C (or some other programming language)? You'd mainly want to look up system calls like open, read, write, dup2, execve, fork, and the like. Of course, you'd need to know C (or some other programming language... Perl?).

But you then said you want to create a Bash shell. I don't know what you mean by that.
  • Azam
  • Born
  • Born
  • Azam
  • Posts: 3
  • Loc: India

Post 3+ Months Ago

hi,

Making your own shell is like creating your own enviroment for handling different
command. You can even have your own command name for a particular command,
like having dir instead of ls command.

First thing you need to sortout is all the basic functionality you want to provide with your
own shell. It can be less than the number of function provided by the bash shell.
How to make such function in a shell ? For that you need to know the system calls
of linux platform. For example, for 'ls' command you need to know open system call.
Next thing you need to do making a console interface of your own and then register the shell i.e, program you made, with the linux system.
Anyway from where did you get the idea to make your own shell.

Azam.
  • Mas Sehguh
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 1853

Post 3+ Months Ago

Azam wrote:
For example, for 'ls' command you need to know open system call.


In the case of most shells, 'ls' is the name of a separate program that gets called, not a built-in command. A shell should not know what 'ls' is at all, at least not on a linuxy system. tcsh has an ls-F command, though...

Azam wrote:
Next thing you need to do making a console interface of your own and then register the shell i.e, program you made, with the linux system.


Why would you need to register anything? You can run your shell like any program.
  • Azam
  • Born
  • Born
  • Azam
  • Posts: 3
  • Loc: India

Post 3+ Months Ago

Sam Hughes wrote:
Azam wrote:
For example, for 'ls' command you need to know open system call.


In the case of most shells, 'ls' is the name of a separate program that gets called, not a built-in command. A shell should not know what 'ls' is at all, at least not on a linuxy system. tcsh has an ls-F command, though...

Azam wrote:
Next thing you need to do making a console interface of your own and then register the shell i.e, program you made, with the linux system.


Why would you need to register anything? You can run your shell like any program.



You are right that 'ls' ivokes a program but the statement is interpreted by the shell and it is the shell who starts the program. What i mean to say is that he can make his own set of commands which will ivoke a particular program.


About Registering I am not sure but if you dont register the shell with the system how can you
set it as a default shell on startup.

Post Information

  • Total Posts in this topic: 11 posts
  • Users browsing this forum: No registered users and 46 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.