|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
Dear ALL,
I'm C and shell beginner and I should write a sheel that does the following: - reads an input line from standard input, parses the line into commands and arguments, calls the command with the arguments and waits for it to terminate. - includes i/o redirection, environment variables, parameter and command substitution, command line editing and filter management. I would greatly appreciate if anybody could provide me with a shell that has the functionalities mentionned above and that I can start with my learning? Thank you very much for your , Beginner |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
In article <1156594625.077841.217640@m73g2000cwd.googlegroups .com>,
"souissipro" <souissipro@yahoo.fr> wrote: > Dear ALL, > > I'm C and shell beginner You're also a Usenet beginner, I guess. Please don't multi-post; if you must post to multiple groups, cross-post a single article. See http://cfaj.freeshell.org/google/, and see my response in comp.unix.programmer. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
souissipro wrote:
> Dear ALL, > > I'm C and shell beginner and I should write a sheel that does the > following: > - reads an input line from standard input, parses the line into > commands and arguments, calls the command with the arguments and waits > for it to terminate. > - includes i/o redirection, environment variables, parameter and > command substitution, command line editing and filter management. > > I would greatly appreciate if anybody could provide me with a shell > that has the functionalities mentionned above and that I can start with > my learning? > > Thank you very much for your , > > Beginner At the risk of being sarcastic, that's what the shell does. You needn't to anything other than invoke the name of the file in your command shell. If each line of the file begins with a command, then the shell is doing all that work for you. Realize that to do i/o redirection, ... you have to read a manual page or tutorial to see how those work. For example: file: hello.sh contents: echo "hello world" then if you, at the command prompt: $ hello.sh hello world << is the computer's reply from the terminal shell $ ... if you have a specific task, e.g. parsing an input file into commmands ... there are literally hundreds of ways to do it depending on what the job is. Good luck. |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
In article <1156706986.146365.223890@i3g2000cwc.googlegroups. com>,
marty.mcgowan@gmail.com wrote: > souissipro wrote: > > Dear ALL, > > > > I'm C and shell beginner and I should write a sheel that does the > > following: > > - reads an input line from standard input, parses the line into > > commands and arguments, calls the command with the arguments and waits > > for it to terminate. > > - includes i/o redirection, environment variables, parameter and > > command substitution, command line editing and filter management. > > > > I would greatly appreciate if anybody could provide me with a shell > > that has the functionalities mentionned above and that I can start with > > my learning? > > > > Thank you very much for your , > > > > Beginner > At the risk of being sarcastic, that's what the shell does. Duh! He's trying to IMPLEMENT a shell by himself, as a learning exercise. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#5 (permalink) |
|
Messages: n/a
Hébergeur: |
souissipro wrote:
> I'm C and shell beginner and I should write a sheel that does the > following: > - reads an input line from standard input, parses the line > into commands and arguments, calls the command with the > arguments and waits for it to terminate. > - includes i/o redirection, environment variables, > parameter and command substitution, command line editing > and filter management. I'm very dubious; if you are attempting a programming assignment in college for what would be a upper class or graduate level course, there is no possibility that you would be a beginning in C or presumably even in shell scripting. You specifications sound like you are copying from a assignment, but what you are asking is definitely non- trivial, and is beyond what is commonly encountered in all but graduate classes. Beginner, you say? If you are serious in your request, isn't is better to have instead done a survey of other people's code first, to understand what's being asked of you, and the sophistication thereof? > I would greatly appreciate if anybody could provide me > with a shell that has the functionalities mentionned > above and that I can start with my learning? I've written shells _using_ shell (that is, kornshell and bourne shell). Berhaps this is what you need to understand the general idea before you take a very long step off a very short diving board. If you can satisfy the above, then I thing I can provide you with some C source programs that implement shells of varying sophistication. =Brian |
|
![]() |
| Outils de la discussion | |
|
|