LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-01-2006, 12:12 PM   #1
cyberquest
LQ Newbie
 
Registered: Aug 2006
Posts: 8

Rep: Reputation: 0
How to compile C Shell in Debian ???


This is what I type in my Shell console ...

knoppix@1[knoppix]$ cd /usr/include/netinet
knoppix@1[netinet]$ ls
ether.h if_ether.h if_tr.h in.h ip.h ip_icmp.h udp.h
icmp6.h if_fddi.h igmp.h in_systm.h ip6.h tcp.h


My question is ... how do I compile in C Shell ... and yes ... I do realise that I am in Bash.

The version of linux I am using is Kanotix Debian-based Live CD X86.

I have been stucked for this for a long time. I did google for it ... but no answer from anywhere. Any help will truly be appreciated.

Thanks.
 
Old 08-01-2006, 12:18 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Is this installed on a hard drive already?
Otherwise where will you store the programme?

Debian has a package called csh. If you enter csh at the prompt, you will enter that shell if it is installed.
 
Old 08-01-2006, 01:11 PM   #3
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Your thread title and actual thread ask two different questions. Do you want to compile csh as in your title (which peter_robb has already answered), or do you want to compile in csh? If the latter, then surely using gcc (or whatever compiler) is the same and doesn't depend on the shell?

Also, please don't double post.
 
Old 08-02-2006, 03:12 AM   #4
cyberquest
LQ Newbie
 
Registered: Aug 2006
Posts: 8

Original Poster
Rep: Reputation: 0
Linux C Shell ... how to get there from my current bash shell?

Yes I know i nd to be in C shell. So, may I know how do i go to c shell from the command prompt mention above?

Thanks.
 
Old 08-02-2006, 03:45 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Just run "csh" as peter_robb already told you.
 
Old 08-02-2006, 11:54 AM   #6
cyberquest
LQ Newbie
 
Registered: Aug 2006
Posts: 8

Original Poster
Rep: Reputation: 0
So may I know what is the next step?

Ok. This is what I did in the Shell console ... (Linux Kanotix Live CD - not installed in my hard drive)

knoppix@1[knoppix]$ csh
bash: csh: command not found

Actually I hope someone can help me just to compile and execute one very simple 'Hello World' C shell program ... and I will be eternally grateful ... I really mean it.

Thanks
 
Old 08-02-2006, 12:12 PM   #7
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Perhaps you could try "tcsh". Maybe Kanotix/Knoppix don't come with csh on their live CDs? If you had installed those distros to your hard drive, you probably would have been able to obtain csh via the package managers.

As for compiling and executing a C program, I'll assume your file is called hello.c. This example creates an executable named "a.out":

$ gcc hello.c

You would then run that executable as follows:

$ ./a.out

If you want to change the output filename, then use gcc's -o flag:

$ gcc hello.c -o hello
$ ./hello
 
Old 08-02-2006, 02:32 PM   #8
cyberquest
LQ Newbie
 
Registered: Aug 2006
Posts: 8

Original Poster
Rep: Reputation: 0
C Shell compiling still not working

Ok. So I have tried the tcsh. But it is still not working. Here are the shell console msg that I receive ...

knoppix@1[knoppix]$ ls -a
. .czap .links .tzap
.. .firefox .mcop .xchat2
.DCOPserver_Kanotix_:0 .gnome .mozilla .xfce4
.DCOPserver_Kanotix__0 .gnome_private .mozilla-thunderbird .xfwm4rc
.ICEauthority .gtkrc .nessus.keys .xine
.Xauthority .gtkrc-2.0 .nessusrc .xsession-errors
.Xdefaults .kaxtv .qt .zAppRun
.acrorc .kde .szap Desktop
.bashrc .kderc .tecla tmp
.config .klik .thumbnails

knoppix@1[knoppix]$ tcsh
bash: tcsh: command not found

So, is there any other way I can compile the hello world C shell program?


And you did mention I need to download the gcc compiler right? I did some google ... and just wanna check is this the correct website for the correct C shell compiler?

http://gcc.gnu.org/gcc-4.1/
 
Old 08-02-2006, 02:35 PM   #9
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Oops, sorry, I thought you meant a C program. If you did actually mean a C shell program (script?), then that will be an interpreted program and thus will need no compilation.
 
Old 08-02-2006, 02:39 PM   #10
cyberquest
LQ Newbie
 
Registered: Aug 2006
Posts: 8

Original Poster
Rep: Reputation: 0
So how should we go about it?

Ok, so now, how can we create a c shell program under Linux Debian?

From the command console ... what should I type to just get a simple Hello World program?
 
Old 08-03-2006, 07:12 AM   #11
r0b0
Member
 
Registered: Aug 2004
Location: Europe
Posts: 608

Rep: Reputation: 50
1. If you need to run C-shell programms, you need C-shell.
2. It looks like there is no C-shell available on that particular machine. So...
3. ...you need to install a C-shell
4. Being it a live CD doesn't help much.
5. Get a live CD where C-shell is available or...
6. ...install a real distribution on a hard drive and install a C-shell
7. Then you can create your hello world C-shell program like this:

Code:
#!/bin/csh

echo "Hello world"
 
  


Reply



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
How to compile a shell script sathish80 Linux - Newbie 2 03-26-2006 08:55 AM
shell script to compile manojg Linux - Newbie 10 12-17-2005 10:22 AM
how to run a compile file in shell? v3sS0n Linux - Newbie 2 09-25-2004 05:47 AM
shell script to compile java czy11421 Programming 4 04-30-2004 09:42 AM
redhat shell won't compile my drivers! Chypmunk Linux - Software 11 01-29-2002 02:39 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:08 AM.

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
Open Source Consulting | Domain Registration