LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 04-11-2007, 01:36 PM   #1
Ken882
LQ Newbie
 
Registered: Apr 2007
Posts: 6

Rep: Reputation: 0
Where is good old cshell?


I'm new to linux, previously used good old Berkeley flavors of unix (command line). Where do I get a cshell type command window? How do I execute a csh script? When I double click on a .csh file, it only opens up the editor. I'm trying to extract from a .gz file and see references to apt-get. What's that?
 
Old 04-11-2007, 01:40 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
well i've no idea where you're clicking and which editor it is, but at that level i expect you can change standard file associations within your desktop environment. i'd also wonder if these scripts are set as executable? if not most gui file managers will primarily just try to run anything if set as exectuable.

as for real linux (i.e. without X) you can just run "csh script.csh" etc... or still feel free to make csh your shell instead of bash...
 
Old 04-11-2007, 01:46 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,911
Blog Entries: 14

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
Open a "terminal" session to get a command line.

csh should be in /bin/csh assuming you have it installed. It came in with my Debian and RedHat/Fedora installations. If you don't have it you can get it by installing the tcsh package.

If you're familiar with command line in BSD/UNIX you shouldn't have much trouble with it in Linux. The command names are genearlly the same although some have different flags so keep the "man <command>" in mind if you get stuck on usage.

The default shell in Linux is bash (Bourne Again SHell) which is similar to ksh and the posix shell.

If your C script doesn't have an interpreter line at the beginning:
#!/bin/csh
That may be your problem. (# sign is included - this is special syntax). Also may be an issue if your permissions don't include execute (e.g. if read/write rather than read/write/execute). I don't really use the GUI much so don't know either of those IS the issue but they would be at command line so it is reasonable to suppose they would be when double clicked.

P.S. ugh! c-shell

Last edited by MensaWater; 04-11-2007 at 02:16 PM.
 
Old 04-13-2007, 07:29 AM   #4
Ken882
LQ Newbie
 
Registered: Apr 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Back on track

Quote:
Originally Posted by jlightner
Open a "terminal" session to get a command line.

csh should be in /bin/csh...

...the "man <command>" in mind if you get stuck on usage.

The default shell in Linux is bash (Bourne Again SHell) which is similar to ksh and the posix shell.

If your C script doesn't have an interpreter line at the beginning:
#!/bin/csh
This was just enough information to rattle old neurons. csh <script> solved one problem. Another problem was setting the equivalent of '~' which is lowercase 'home'. 'man' helped with that. The script did start with #!/bin/csh, but didn't work until I invoked it within csh or as csh <script>. I don't understand that yet, but otherwise I'm making progress now!

Ken
 
Old 04-13-2007, 08:54 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,911
Blog Entries: 14

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
You might want to verify where csh is:

which csh

If it weren't /bin/csh then the #!/bin/csh wouldn't work - changing it to the path you get from the which should help then.

Also make sure the script is executable and in your path. If it weren't that would explain why "csh script" rather than just "script" works. In the former you are executing csh rather than script and telling csh to take script as its input. In the latter you are executing script directly so it must follow the rules for executables.

Last edited by MensaWater; 04-13-2007 at 08:59 AM.
 
  


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
LXer: Reviewer finds Ubuntu good, but not good enough LXer Syndicated Linux News 0 01-05-2006 06:01 AM
Recommend a good BitTorrent client, and a good CD ripper? audiorevolution Linux - Software 6 06-07-2005 06:36 AM
Good morning, Good evening, Good night. Cheeseboy LinuxQuestions.org Member Intro 2 11-04-2004 09:46 PM
[cshell] awk help! saiz66 Programming 3 09-28-2004 06:55 PM
Cshell querying two files... HiOctane21 Programming 1 05-01-2004 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:29 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration