Questions tagged [csh]

The C shell (csh or tcsh) is an alternative to the Bourne shell (sh) which is the default with Ubuntu Linux.

csh is a Unix shell that was created by Bill Joy while he was a graduate student at University of California, Berkeley in the late 1970s. It can be used instead of the default Bourne shell on Ubuntu Linux.

C shell

47 questions
9
votes
2 answers

No csh or tcsh?

In /bin, I see bash, but no csh or tcsh. When I created a ".cshrc" file in my home directory, it had no effect; that's how I discovered this problem. So the question is this: how do I switch to csh/tcsh type of login? Thanks for your help.
6
votes
1 answer

How do I set a variable to a command's output in csh?

I have a number in a text file like : int_width: 5230 I want to set this number (5230) to a variable in csh. What is the correct form? (grep is working before setting) set WIDTH = "$(grep int_width *.txt | sed 's/[^0-9]*//g')"
Krsztr
  • 477
5
votes
2 answers

How to run a csh script to install f2c?

I need to install f2c in Linux. Given the steps; Download installation script : Download install_f2c_linux.csh. Run installation script # chmod +x install_f2c_linux.csh # ./install_f2c_linux.csh I run the second step in the root and user…
4
votes
2 answers

Opening a .PS from command line

I want to open a .PS (postscript file) having produced it from a .csh script running a series of GMT commands preferably using ghostview. I am trying: gv plot.ps This however opens ghostview but not my plot. Instead I just get the spinning wheel.…
Alexander Peace
  • 101
  • 2
  • 2
  • 8
3
votes
1 answer

echo $SHELL: unexpected result

I am facing a problem related to the shell change, when I change the shell from bash to csh and type the comand echo $SHELL, I expect the shell to print: /bin/csh But instead it prints: /bin/bash What is the reason for that? How do I print the…
eng_ahmed
  • 39
  • 1
  • 5
3
votes
3 answers

how to source csh script from bash environment?

I am using bash shell but some of the scripts that I need to source are in csh format. Can somebody tell how I can source csh scripts from bash shell? By sourcing I mean the sourced csh script should be able to set the environment variables. So, I…
3
votes
1 answer

Condense multiple similar alias

I have been working on creating new alias to use at work and noticed my .csh file filling with similar alias that go to different sub-directories but everything else is the same. I am newer at terminal alias and commands, and I was wondering if it…
Michael
  • 31
3
votes
1 answer

How to integrate "run as shell script" in right click menu of file manager?

Now when I want to run a shell script (.sh or .csh file), I need to right click the file manager and click "open terminal here", then type "./xxx.sh" to run the shell script file. It is very inconvenient for me. However is there any way to integrate…
pah8J
  • 351
2
votes
2 answers

Problem in awk command

I have to extract latitude and longitude from an ASCII text file in Ubuntu using the awk command. I wrote the code below and saved it in untitled.sh: #!/bin/csh -f set file = $1 if($1! = "") then awk'{ \ if(NR == 1) NCOLS = $2; \ if(NR == 2) NROWS…
2
votes
1 answer

Graphical displays in .cshrc or .login files

I decided to follow a UNIX tutorial just to understand my Kubuntu a little bit more, in the tutorial's eighth chapter, I am advised to WARNING: NEVER put commands that run graphical displays (e.g. a web browser) in your .cshrc or .login file. I…
Hans
  • 1,301
2
votes
1 answer

Looping through directories using a csh command

I am trying to get a list of folders in my directory 'KEAX', and then dive into each one of them. After entering each folder, I want to run the command: foreach f(*.tar) tar -xvf$f end After running this command, I want to back out, and then go…
WX_M
  • 121
2
votes
2 answers

Extract a date from a filename for CSH script?

I am trying to write a CSH script that will look at components of the filename to generate a date/time. The problem is, I have no idea how to extract part of a filename to use it. Here is a sample filename: nam_218_20140126_1800_001.grb 20140126…
WxPilot
  • 1,946
2
votes
1 answer

Unable to use variables in alias in cshell

This is a sample straight forward program. I am using C-shell and want a solution for this environment itself. Following this code sample: set FILENAME = "\!:2" alias jo 'echo this is my \!:1 file and its name is $FILENAME' on command line when I…
1
vote
2 answers

How do I fix "MANPATH: undefined variable." in csh?

I am installing some open source software by compiling its source code -- on Ubuntu 16.04 -- by following the instructions in its 'readme' file. At certain point (point 3b in the link) the guideline requires me to run a .csh file located in a…
1
vote
1 answer

removing bulk pdf password

I have a bunch of pdf files and its password in another file, I need to find a way to remove password protection and create a unencrypted pdf file, with the same file name. What would be a best possible way to do it. Something like, read each pdf…
1
2 3 4