PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > C and shell writing
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

C and shell writing

Réponse
 
LinkBack Outils de la discussion
Vieux 26/08/2006, 13h17   #1 (permalink)
souissipro
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut C and shell writing

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

  Réponse avec citation
Vieux 26/08/2006, 17h40   #2 (permalink)
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C and shell writing

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 ***
  Réponse avec citation
Vieux 27/08/2006, 20h29   #3 (permalink)
marty.mcgowan@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C and shell writing

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.

  Réponse avec citation
Vieux 27/08/2006, 23h22   #4 (permalink)
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C and shell writing

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 ***
  Réponse avec citation
Vieux 29/08/2006, 04h55   #5 (permalink)
bsh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: C and shell writing

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

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h34.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11042 seconds with 13 queries