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

Unix Shell Script to take multiple files from standard input (csh)

Using either the for loop or the pipe (both work with one filename), I need to figure out how to accept unlimited specified files from standard input. I have tried regular expressions, and various wildcard forms. The two main issues I'm running…
0
votes
1 answer

Shell Script - Search before 'touching' the file. (csh)

Homework - don't just throw me an answer, but I've literally been stuck on this for days. That also explains why I'm stuck using csh, which is of course exacerbating the problem. The shell script needs to search a file for a string and replace it…
0
votes
1 answer

Testing the hostname in a .cshrc

I would like my .cshrc file to carry out several commands depending on the host I've logged in to (the .cshrc file is on a disk that is shared by two different hosts). Let's assume the two hosts are: login1.university.edu and login2.university.edu I…
user1701545
  • 5,706
  • 14
  • 49
  • 80
0
votes
1 answer

can not open .cshrc after modifying

I am on a RedHat csh. I just modified ~/.cshrc with a wrong path and resulting in an syntax-error. my shell just not recognize ls or gedit. So, when I again try to modify, it is not again opening with gedit ~/.cshrc. When I boot the system it is not…
diffracteD
  • 758
  • 3
  • 10
  • 32
0
votes
1 answer

solaris zlogin run command from nosuperuser

i want execute long running command from global zone in csh shell in zlogin non-interactive mode zlogin zone1 su - adm /usr/bin/stop_c & Warning: no access to tty; thus no job control in this shell... Oracle Corporation SunOS 5.10 …
quest
  • 25
  • 1
  • 1
  • 6
0
votes
2 answers

executing a makefile in many child directories with a linux csh script

I am trying to write a csh script which will execute a makefile in child directories when present. So far I have this: find -maxdepth 2 -name 'Makefile' -print -execdir make \; The issue I'm facing is that I get the following error when I try to…
Louie Mazin
  • 83
  • 2
  • 9
0
votes
2 answers

Write a script in Linux to run make in every child directory maxdepth of 2

I am looking to write a script to go into each child directory (not recursively) and run a make file to create a binary. One way to do this is to change directories and run make for each folder but it's not very elegant and can be error prone if…
Louie Mazin
  • 83
  • 2
  • 9
0
votes
0 answers

Bad: modifier in $ (/). on login in csh

I am getting this error(?) message every time I log into the server I am connecting to. I also get it every time I run any C-shell program, multiple times if I use recursion. It seemed to show up after I tried to set up my PATH variable with…
pele
  • 23
  • 3
0
votes
2 answers

Mass file renaming in Csh

I'm trying to rename all the files in a directory in csh (I'm using FreeNAS). I thought I had the hang of it until I accidentally prepended to the whole file name so now I have files of the format Veronica Mars - 1x22 Leave It to Beaver.mkv - HDTV…
Hackling
  • 113
  • 4
0
votes
1 answer

Execute c shell commands with variables

How do I pass variables as parameters to commands in a c shell? Something like this: vncserver -depth $BITDEPTH -geometry $WIDTHx$HEIGHT I appreciate your help! Thank you!
MichaelScott
  • 387
  • 1
  • 3
  • 21
0
votes
1 answer

Pass Python3 variable to C Shell Script

I did hours on research regarding the following question but I wasn't able to find an answer at all. Though there seem to be many fellows having problems with that. I hope I will recieve some help from the community. ;) I have a Cshell script where…
Johngoldenboy
  • 168
  • 3
  • 14
0
votes
0 answers

Package tcsh shell inside a windows application

I have a customer script in csh, which I need to include in an add-on package for multiple platforms. It internally sets environment variable values as platform specific e.g. !/bin/csh -f setenv USERPLATFORM [win32|lnx86|sun5] set…
ggupta
  • 1
0
votes
1 answer

Save multiple results from AWK to shell variables

Save multiple results from an AWK script to c shell variables. I have a simple AWK script running in the terminal to find max and min from an input text file. How do we save this max and min values to c shell variable in order to use it later. Here…
Indigo
  • 2,887
  • 11
  • 52
  • 83
0
votes
2 answers

How to download all files from hidden directory

I have do download all log files from a virtual directory within a site. The access to virtual directory is forbidden but files are accessible. I have manually entered the file names to download dir="Mar" for ((i=1;i<100;i++)); do wget…
Tom Iv
  • 409
  • 1
  • 5
  • 21
0
votes
1 answer

How do you include a variable in a continuous sequence of characters

In csh, I have a variable called $var and I want to include it in a csh script as follows #!/bin/csh set var="directory" sed 's/DIRECTORY_PATH/$var1234/' > output.txt I want the sed statement to evaluate to 's/DIRECTORY_PATH/directory1234', but…
andrew
  • 2,524
  • 2
  • 24
  • 36