LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-26-2008, 02:55 PM   #1
alpaccino_lindo
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Rep: Reputation: 0
Question Shell programming Help (i'm clueless)


good day to you all. i am very new not just to this site but to linux too. i have a project to do and i'm getting no where from my lecturer. i am to write my own shell and i have some questions for you all.

1) is a shell the same thing as a terminal?
2) the instruction says that i'm provided with lex.c and myshell.c what are these and where in ubuntu do i find it.

3) should my shell be created in C language or in a shell like BASH or something, if you say C, what C compiler is there for ubuntu.

thanks for now
 
Old 06-26-2008, 03:04 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
You are in over your head right now.

This isn't about shell programming; this is about C programming, and your project is to create a shell program from C.

Might be time for a more introductory course.
 
Old 06-26-2008, 03:31 PM   #3
alpaccino_lindo
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Original Poster
Rep: Reputation: 0
i did not say i don't know any programming language i'm just having problems figuring out linux, and this assignment. thank for your help though, one more question is there a c compiler in linux.
 
Old 06-26-2008, 03:38 PM   #4
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 35
Yes, check http://gcc.gnu.org/. You can install it through adept or whatever you're using.
 
Old 06-26-2008, 03:45 PM   #5
alpaccino_lindo
LQ Newbie
 
Registered: Jun 2008
Posts: 3

Original Poster
Rep: Reputation: 0
thanks for your help

Quote:
Originally Posted by General Failure View Post
Yes, check http://gcc.gnu.org/. You can install it through adept or whatever you're using.
thanks for you help
 
Old 06-26-2008, 07:28 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by alpaccino_lindo View Post
1) is a shell the same thing as a terminal?
No. A shell is a command interpreter, with more or less functionalities. A terminal emulator is a program that emulates the behavior of a physical terminal. A shell runs into a terminal emulator, or in a virtual linux console if you are not using X.

Quote:
2) the instruction says that i'm provided with lex.c and myshell.c what are these and where in ubuntu do i find it.
No idea what instructions are you talking about.

Quote:
3) should my shell be created in C language or in a shell like BASH or something, if you say C, what C compiler is there for ubuntu.

thanks for now
The standard C compiler for all linuxes is gcc, the GNU C Compiler.

Last edited by i92guboj; 06-26-2008 at 07:31 PM.
 
Old 06-26-2008, 07:42 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
You have a choice of many shells on Linux. For instance on the openSUSE v10.2 I'm on here, if I run the cmd

cat /etc/shells

I get the following

/bin/ash
/bin/bash
/bin/bash1
/bin/csh
/bin/false
/bin/ksh
/bin/sh
/bin/tcsh
/bin/true
/bin/zsh
/usr/bin/csh
/usr/bin/ksh
/usr/bin/passwd
/usr/bin/bash
/usr/bin/rbash
/usr/bin/tcsh
/usr/bin/zsh


those are all the shells available to me.
Try the same cmd on your system, you should get a similar list.
To see your default shell, ie the one the system assigns you at login, use

grep <yourusername> /etc/passwd

the last field is your shell.

Here is a really good Linux tutorial : http://rute.2038bug.com/index.html.gz

HTH
 
Old 06-26-2008, 09:56 PM   #8
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
I'll also offer a brief overview of unix/linux here:

http://cis68a.mikecappella.com/

See the Notes, and homework too if desired.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Programming manolakis Programming 5 05-20-2008 05:20 AM
Shell programming pawarsac Linux - Newbie 4 08-05-2006 05:43 AM
programming shell tuls Slackware 3 08-24-2005 06:58 PM


All times are GMT -5. The time now is 06:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration