Does anyone use csh




















If something does not work for you, you just write it in bash or sh. This is what is "! To start quickly, use my. You probably don't want Polish locale. Easy things are usually easy, sometimes hard things are easy, sometimes easy-seeming things are hard. No shell is particularly better than the others in this area but some are worse I can't seriously recommend csh. Some will say that bash is the worst 'modern' shell, which may be true but you can't completely escape it anyway.

There's an argument to be made that using the most 'popular' shell is best for maintainability for the same reason Windows is best and I'm not saying that it is : It's easy to find people you can hire who know how to use it. There are simply more people who have at least a passing familiarity with bash-specific features, say, than ksh or zsh.

Finding people who actually understand what they're doing is another matter. All shells have various gotchas, corner-cases and weird behaviors.

Mostly it comes down to what you're used to. Nearly every shell you'll see is highly portable to almost every platform. Even though this is true you won't necessarily be able to run the same say bash script on three different boxes unless you were careful about what utilities you used and which options you passed them. Writing portable shell scripts is hard for reasons having nothing to do with which shell they're written for. Nearly every Linux uses bash by default and has most shells available.

FreeBSD includes sh, csh and tcsh by default with bash and others in ports. Once upon a long time ago, Mac OS X used tcsh by default, but it now uses bash by default, and includes zsh along with most common shells. Beyond that I cannot comment. Personally I use bash out of mostly inertia. If I weren't so familiar with it already I would use zsh instead.

It is also good at scripting, for a shell arrays and hashes, quoting, string manipulation ; though writing reliable scripts requires you to learn a lot more.

If you want your programs to be able to grow, work with elaborate data structures, and use some useful libraries, you should learn a language like python, ruby or perl. Most of those have interactive interpreters as well, not as convenient as a shell but useful for quick testing.

IPython, for Python, is particularly useful; it lets you explore documentation very easily, can load and reload source, includes a debugger. It also includes some standard shell commands and can pass the rest to a standard shell by prefixing them with a!

Command line editing allows you to access any command from the history list and make edits to it before execution. Typing inserts text into the command, the Backspace and Delete keys can be used to erase characters from the command. If the filename is unique tcsh will type the rest of it. If the filename isn't unique tcsh will complete as much as possible and beep. If you want to look at file2. Since file2. To change what shell you use type chsh CHange SHell and type in the location of the new shell when prompted.

The new shell will not take effect until the next time you log on and will stay in effect until you change it again. For more information about csh and tcsh, consult the appropriate man page man [shell name] or send me e-mail at mcrip u. I say 'indicative' above, because the idea of a file extension doesn't technically exist and has no semantic or syntactical meaning. A file could be named script.

For more definitive confirmation, look at the first line of the file. For a script designed to be executed directly, it should start with a shebang line, which starts with an octothorpe , a bang!

For example:. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Asked 4 years, 6 months ago. Active 4 years, 6 months ago. Viewed 12k times. It always says though, for example: Set the environment variables before using the compiler. Improve this question. I am continually shocked and dismayed to see people write test cases, install scripts, and other random hackery using the csh.

The csh is seductive because the conditionals are more C-like, so the path of least resistance if chosen and a csh script is written. Sadly, this is a lost cause, and the programmer seldom even realizes it, even when they find that many simple things they wish to do range from cumbersome to impossible in the csh.

The most common problem encountered in csh programming is that you can't do file-descriptor manipulation. All you are able to do is redirect stdin , or stdout , or dup stderr into stdout. Bourne-compatible shells offer you an abundance of more exotic possibilities. In the Bourne shell, you can open or dup random file descriptors.

Or what if you just want to throw away stderr and leave stdout alone? Pretty simple operation, eh? So it's wrong. This simple operation cannot be done in the csh. What if you've redirected stdin? Tough noogies, you still get your tty, which you really can't redirect.

Now, the read statement in the Bourne shell allows you to read from stdin , which catches redirection.



0コメント

  • 1000 / 1000