Questions tagged [csh]

csh, or the C shell, is a command interpreter with a syntax reminiscent of the C programming language.

Quoted from the Solaris csh man page:

csh, the C shell, is a command interpreter with a syntax reminiscent of the C language. It provides a number of convenient features for interactive use that are not available with the Bourne shell, including filename completion, command aliasing, history substitution, job control, and a number of built-in commands. As with the Bourne shell, the C shell provides variable, command and filename substitution.

csh first appeared in 2BSD, and was originally created by Bill Joy. While Bourne shells are more popular, csh-style shells are still fairly popular especially in the BSD community & academia.

is an an enhanced version of csh, almost all versions of csh encountered nowadays are actually tcsh.

Programming in csh is a controversial topic. For one viewpoint, see this article.

1173 questions
0
votes
1 answer

echo from csh script not showing up on terminal

I am currently executing a csh shell script from a GUI button. The script originally calls another sql script to select information from a database and output it to a log file in the tmp directory. I now need to CAT that file and display it on the…
rambokayambo
  • 341
  • 4
  • 10
  • 27
0
votes
0 answers

cannot run cshell script from java wrapper class

I have a java class in which i call a runshellscript method that will execute a script. It worked well with mysql but i cannot seem to find out why it wont work well with psql. Here is an excerpt of my runshell method public static void…
rambokayambo
  • 341
  • 4
  • 10
  • 27
0
votes
3 answers

grep: broken pipe error python 2.2

I'm taking in a bunch of scripts, and creating a wrapper for them in python. I didn't create the scripts that were given to me. Currently I'm working with python 2.2, and the shell I'm using is a csh shell. When I run the script in the following…
de1337ed
  • 3,113
  • 12
  • 37
  • 55
0
votes
2 answers

How to set the following in .cshrc for aliasing

I have following alias in my .cshrc alias fe-fat "source fat /prj/work" alias fe-fat1 "source fat1 /prj/work" I wanted to know if we can set some variable for fat/fat1 and club the above 2 aliases into a single alias somewhat like the below, so…
James bond
  • 459
  • 1
  • 4
  • 13
0
votes
1 answer

copy a file to an existing directory but says directory doesnt exit

i am tryign to copy a file from one directoy that i am to a directory that already exists but the terminal gives me an error saying that it cannot create the file and that it does not exist cp networkset.dat /projects/segra/hallo/data/binet no such…
rambokayambo
  • 341
  • 4
  • 10
  • 27
0
votes
1 answer

How to find from within a csh script whether a certain command is available?

In a csh script, I need to perform something only if a certain command is available. I wanted to do something like if( _WHAT_TO_PUT_HERE_ ) then # enter only if command "cmd" is in the path cmd ... endif how to do that in csh or tcsh?
Walter
  • 44,150
  • 20
  • 113
  • 196
0
votes
1 answer

C shell no idea what this line does (string stuff)

Crappy title, yes. But I honestly have no idea what this particular line of code does, aside from the fact that it probably passes some argument into a perl script. Here's the line: dbget.pl "params::INSTANCES_*" | /bin/sed -e 's/^setenv \(.*\)…
JDS
  • 16,388
  • 47
  • 161
  • 224
0
votes
1 answer

Getting unmatched ". on a simple csh ssh script

I'm trying to connect to a set of machines using foreach to check whether or not a file exists, however I keep getting the unmatched " error, I've tried plenty of ways and plenty of escape character to try to make it work... however I still get the…
Dan V
  • 375
  • 2
  • 4
  • 11
0
votes
2 answers

Csh eval statement?

I'm trying to understand how the eval statement works. Here's a snippet of code I'm looking at that I don't understand: eval `$SOME_DIR/util/dbget.pl \ VARIABLE1 \ VARIABLE2 \ VARIABLE3 \ VARIABLE4…
JDS
  • 16,388
  • 47
  • 161
  • 224
0
votes
1 answer

Quotes around $VARIABLE?

What does a line of code like this do? if ("$MY_VARIABLE" == "some_string") ... Is that just how csh interprets variables as strings for comparison and assignment?
JDS
  • 16,388
  • 47
  • 161
  • 224
0
votes
1 answer

Bad resource requirement syntax Error

I am trying to use the memory resource allocation command available in LSF. A normal format of the command is : bsub -R "rusage [mem=1000]" sleep 100s When I launch this command directly from terminal,it works. When i lsunch this command from a…
Ani
  • 918
  • 1
  • 10
  • 25
0
votes
1 answer

Linux: Possible to extend and Alias?

A simple example: Let's say I have one alias being sourced somewhere as: alias ls 'ls -o' I'd like to have a second alias add on to this: alias ls 'ls -a' So that when I execute it, I'm really getting: ls -o -a Is this possible? Of course in the…
ack
  • 14,285
  • 22
  • 55
  • 73
0
votes
1 answer

Modifying script to apply former processes on former input to any possible number of inputs

I currently have this script set up for $1 $2 which takes two inputs, one an extension, one the file name, and searches for the file name in the relative path, if found, replaces the file with the new extension (or does nothing if same extension),…
user1205371
0
votes
1 answer

Getting stdout+stderr in a log file

I am trying to implement something which my logic says can't be done. But I need your help to understand why can't it be. Short Version of Question Is it possible to log stdout+stderr of a script in csh without using file redirection ( >& or tee…
Ani
  • 918
  • 1
  • 10
  • 25
0
votes
1 answer

What does the -b argument do in csh?

I am looking at a tcsh script that has the following shebang line: #!/bin/tcsh -fb # then executes some commands What does the -b do? From the man page: -b Forces a ''break'' from option processing, causing any further shell arguments to …
andrewrjones
  • 1,801
  • 21
  • 25