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
-1
votes
1 answer

error in Unix (scripts)

somebody knows what does this error mean? Missing -. in google I found nothing about this
lego69
  • 767
  • 1
  • 12
  • 20
-1
votes
1 answer

extract letters by counting them

I am looking for extracting some of the string by counting the letter from the beginning in csh shell. For example, set a = "hello 911 is not 91 only" I want to extract letter from position 8 to 10 which is 911, similar to a(8:10). Similarly, 20 to…
user3288812
  • 25
  • 1
  • 5
-1
votes
2 answers

Trouble Running Perl Script from within Shell Script

I am trying to run a perl script from within a *.csh script, but I get the following error: Can't open perl script "checkLength.perl": No such file or directory I think it has something to do with the path of the perl script. I can run a perl…
geeb.24
  • 527
  • 2
  • 7
  • 25
-1
votes
1 answer

How to find a directory in Unix, whose ordinary files have the greatest line count together

Ok, to be clear, this is a school assignment, and I don't need the entire code. The problem is this: I use set subory = ("$subory:q" `sh -c "find '$cesta' -type f 2> /dev/null"`) to fill variable subory with all ordinary files in specified path.…
Slaaavo
  • 112
  • 1
  • 11
-1
votes
1 answer

regex - to check if input is number in csh(unix)

Please help. How to make regex work in an if condition, to check user input(in 2nd parameter) must be not equal to any number? set regex="^[0-9]+$" if ($#argv == 2 && $2 != $regex) then # do this
user68890
  • 69
  • 1
  • 4
  • 10
-1
votes
3 answers

Unix - Csh: How to load new shell with clear environment?

I have a csh shell that is "dirty" with a lot of modifications in PATH, in LD_LIBRARY_PATH and in more environment variables. I want to load a "clean" csh shell that will not "inherit" all the environment settings from the existing one, but that…
SomethingSomething
  • 11,491
  • 17
  • 68
  • 126
-1
votes
1 answer

How to generically add executable to user's path

What is the best way to add an executable to one of a computer's $PATH directories? I am writing an installation script, and know that the names of the PATH directories can vary, as do the directories' permissions, so what is the best way to do…
Christopher Shroba
  • 7,006
  • 8
  • 40
  • 68
-1
votes
3 answers

How do you write a csh alias that invokes bash and calls the .profile from a different location?

I would like to write an alias in csh that will call bash and then change dir to a different dir to grab the .profile For example: alias setbash 'bash -o vi; cd bashdir; . ./.profile' That alias statement invokes the bash -o vi but once it has the…
-1
votes
2 answers

how to extract specific name from folder or file name

I'm new to linux command. Now I would like to extract only date value from listed file name and compare as a date value. Example: /underdirectory 20080206 20080207 bk_20080208 I want to listed all above directories and compare date, means this…
kohtoo
  • 15
  • 5
-1
votes
2 answers

Syntax error in CShell Script

Write Script to read a positive integer number then it computes the following sequence: If the number is even, halve it If it is odd multiply it by 3 and add1 You should repeat this process until the value is 1, printing out each value and how many…
sara
  • 13
  • 1
  • 3
-1
votes
1 answer

Command not found when running a local executable from csh script

My current project involves the use of a .go executable written on Fortran 77 in the mid-eighties. My only access to it currently is through ssh to a server using csh. I have written the following script: set inpdir = $argv[1] mkdir…
-1
votes
1 answer

Changing csh expression to tcl

I need to change the following piece of code from shell to tcl. if (!$?OSTYPE && $?OSREV && $?HOST))then I need to know how to combine all the and conditions and then negate the combined result in tcl.
-1
votes
1 answer

How to redirect php exec stderr into output array when shell is csh?

Possible Duplicate: How to redirect stdout and stderr from csh script I've done this many times before when the server's execution shell is sh or bash: exec('dostuff 2>&1', $output, $return); But now my server is on FreeBSD and the Apache…
user9645
  • 6,286
  • 6
  • 29
  • 43
-2
votes
1 answer

C shell remove line from file

I have a file output.txt. File looks like this: name1 10 name2 12 name3 5 I get a number n and I need to remove all lines which have number (after name) smaller or equal to number n.
Jakub Rosina
  • 59
  • 2
  • 7
-2
votes
1 answer

Why is there an undefined variable when I am trying to invoke csh

I am trying to invoke csh from the terminal using: $csh SDB: Undefined variable. I never faced this before and I do not really understand what is meant by SDB here and how is it an undefined variable? Any ideas?