LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where is good old cshell? (https://www.linuxquestions.org/questions/linux-newbie-8/where-is-good-old-cshell-545196/)

Ken882 04-11-2007 01:36 PM

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?

acid_kewpie 04-11-2007 01:40 PM

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...

MensaWater 04-11-2007 01:46 PM

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 :p

Ken882 04-13-2007 07:29 AM

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

MensaWater 04-13-2007 08:54 AM

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.


All times are GMT -5. The time now is 12:18 PM.