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

format and change sql output xls file column heading in unix sql script

I wanna change my column heading and format it to ceratin size so all dat can be seen in xls output file which is generated through sql script.. For example if the name of column is Lst_name.. on my xls column heading i wanna change it to Last Name…
jack
  • 163
  • 3
  • 9
  • 20
-1
votes
1 answer

why might the "exit" command in a linux shell not work?

I have a user which hangs when he runs a csh script that doesn nothing byt "exit"... # This is the x.csh script exit Then he... tcsh x.csh It hangs. "which exit" gives "exit: shell built-in command." Any ideas ?
daveg
  • 1,051
  • 11
  • 24
-1
votes
3 answers

Redirection using tee and sed

What am I doing wrong here? I don't get any STDOUT from tee but test.log is populated correctly. perl test.pl | tee -i | sed 's/\x1b\[[0-9;]*m//g' > test.log My goal is to sent everything printed by test.pl to STDOUT and dump a filtered…
Jean
  • 21,665
  • 24
  • 69
  • 119
-1
votes
1 answer

"Illegal variable name" error when running "docker stop $(docker ps -a -q)"

I am trying to issue command docker stop $(docker ps -a -q) over ssh, using Python's paramiko package stdin,stdout,stderr = ssh_client.exec_command('docker stop $(docker ps -a -q)'); print stderr.readlines() I get an error Illegal variable name. I…
tallharish
  • 242
  • 1
  • 12
-1
votes
4 answers

how to copy lines one by one from a file and paste then into another file after every n lines using shell script

say i have file1 with content line1 line2 line3 and another file2 with content lineA lineB lineC lineD lineE lineF lineG lineH lineI I want to make file2 as lineA lineB lineC line1 lineD lineE lineF line2 lineG lineH lineI line3
psi
  • 77
  • 1
  • 11
-1
votes
1 answer

print column to many row awk

i stuck at this problem for a long time. i have a input file with many line like…
Lucil120
  • 63
  • 5
-1
votes
1 answer

select a string from file csh

I have a file file.dat as follow: 1.1,2.1 1.4 3.1,2.1 2.4 2.4,4.5 11.5 .. And I want to select each time the whole line (string) and replace it in another file. So far I tried the following #!/bin/csh set FILENAME = 'file.dat' # file in which the…
-1
votes
1 answer

Why does a csh script that executes on Sun (Unix) opens in Notepad on Windows?

A csh script that takes 2 arguments is executed using system() call from a JNI C++ function as follows: int ret = system("abc.csh C:\tmp\file.tmp $VAR_NAME"); When run on Sun, the script executes properly accepts both arguments and writes value…
Amit
  • 29
-1
votes
2 answers

How to grep query all files for 2 strings when filenames have spaces?

I need to query java files which have both the strings 'rESTWSLib' and '500'. Both the strings could be anywhere in the document (i.e. line) and can be positioned anywhere on 0-infinite lines (position 0-n). How to grep query for 'rESTWSLIB': find…
AutoTester999
  • 528
  • 1
  • 6
  • 25
-1
votes
4 answers

How to remove unknown file extensions from files using script

I can remove file extensions if I know the extensions, for example to remove .txt from files: foreach file (`find . -type f`) mv $file `basename $file .txt` end However if I don't know what kind of file extension to begin with, how would I do…
Ian Chang
  • 27
  • 1
  • 4
-1
votes
3 answers

What does `setenv DISPLAY name:1001.0` mean in Linux?

I'm doing some work using Linux server, after I log on to the server,the tutorial says: If you need to run any program which will open a window, like xterm, from these servers, you need to set display first. To do that, I need to execute…
Yuan Wen
  • 1,583
  • 3
  • 20
  • 38
-1
votes
1 answer

vncserver bash script error in ubuntu 14.04.4 LTS

I use Ubuntu 14.04.4 LTS and installed vnc4server. The basic script starting vncdesktops is under /etc/init.d/vncserver which is a bash script. This works fine for all users specified in /etc/vncserver/vncservers.conf with their arguments. But when…
Chan Kim
  • 5,177
  • 12
  • 57
  • 112
-1
votes
2 answers

Why is tail not working here?

My csh script #!/bin/csh # C-schell script to increase the boundingbox.... echo '%\!PS-Adobe-3.0 EPSF-3.0' echo '%%BoundingBox: 0 0 1100 1100' tail +3 $argv[1] Called here csh bbox.csh plt >! plt_P1.ps But I have csh -f bbox.csh plt tail: cannot…
Richard Rublev
  • 7,718
  • 16
  • 77
  • 121
-1
votes
2 answers

How to translate switch statement to Perl

I am porting a csh script to Perl. I am doing a switch statement in Perl. I am not sure if this is right, based on the different comments that switch statements are no longer in use in Perl. Can you please give me an idea if this is right? Also in…
luxy
  • 65
  • 1
  • 4
-1
votes
2 answers

$# behaviour in CSH

I have noticed a bit of a strange behaviour of $# in CSH. For example set a=(Hello world); echo $#a will output 2 as expected. Why does $# act differently with combination of environment variables? echo $#PATH will actually output PATH ignoring #…
J91321
  • 697
  • 1
  • 7
  • 19