2022 Developer Survey is open! Take survey.

Questions tagged [csh]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
34 views

How can I change directory text color in C shell?

I want to change directory color in cshell. So I copied /etc/DIR_COLORS file to my ~$home and named .dir_colors. I modified that file but it doesnt change the text color. If I source that file then ...
user avatar
  • 1
0 votes
1 answer
45 views

Reference all paths in single linux script - like a header file for better portability [closed]

Shell Scripting newbie here. Please bear with me. Linux 3.0.101-108.87-default x86_64 I have Script1.sh which is referencing folders . I am trying to include all these paths in the script in a single ...
user avatar
0 votes
0 answers
363 views

illegal variable name with csh and tcsh

Ubuntu 20.04 with update on about 1 May 2021. NOT a linux expert. in bash terminal, % which csh /usr/bin/csh but when % csh illegal variable name. same for tcsh.
user avatar
-2 votes
2 answers
75 views

Redirect output with '>&!'

I know that >& means redirect stderr to stdout. But I don't know the meaning of >&!, I tried following command but it seems like normal. Example: cat xxx.txt >&! xxx.output My ...
user avatar
0 votes
1 answer
383 views

How to capture output from a command and pass it on to a variable in csh scripting?

I'm trying to capture output of command into variable in csh but its printing empty value to the variable. but if i run same command on terminal its working root_part_id=`gpart show | grep zfs | awk '{...
user avatar
0 votes
1 answer
68 views

Setting Gnome extension from C shell (csh)

I want to set the enabled-extension but when I do this, it doesn't work. echo just prints to console and exec either say "File name too long" or shows me the usage for gsettings. But if I ...
user avatar
  • 1
0 votes
0 answers
623 views

I can't run my csh-script in Ubuntu

I write sch-script (cm2.csh) and trying to run in Ubintu (c shell installed), but receive error like: bash: ./cm2.csh: /bin/csh/: bad interpreter: Not a directory This is my script: #!/bin/csh -f ...
user avatar
1 vote
1 answer
124 views

Shared library seems installed but I get an error anyway

Objective: Install/run an app through csh or tcsh, it's a 3d liquid simulation app called realflow. Background: I downloaded the app, try to run it through csh or tcsh. I get strings: 'lib/i386-...
user avatar
  • 11
0 votes
1 answer
53 views

Trying to enter a directory from the first line of another file

Currently using csh at workplace. So what i currently have is a path stored in the first line of a file and i am trying to read that. head -n 1 jvar.txt Now i have to go to that path so i was ...
user avatar
5 votes
2 answers
1k views

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 ...
user avatar
0 votes
1 answer
706 views

Error while executing read prompt in csh and converting to multiline alias

Hey everyone i have this issue where i have a sample program in csh (i know its not the best language to use for scripting but i dont have an option here) its as foll: #!/bin/csh echo 'please ...
user avatar
2 votes
1 answer
975 views

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 ...
user avatar
0 votes
1 answer
233 views

Why will "0.0u 0.0s 0:00.00 0.0% 0+0k 0+0io 0pf+0w" display on screen from cshell? [closed]

friends, I don't know why "0.0u 0.0s 0:00.00 0.0% 0+0k 0+0io 0pf+0w" (and many lines like this) will display when I run some C shell script, but not when some others run. And I never encountered with ...
user avatar
  • 1
1 vote
1 answer
1k views

How to set up a loop in csh to set variables to directory names?

My file structure is like this. unix% ls NGC2201 IC0499 IC7216 NGC7169 unix% cd NGC2201 unix% ls 7019 2221 note where 7019 and 2221 are new directories and note is a text file that I use to create ...
user avatar
  • 313
0 votes
2 answers
264 views

Using a file to input variables in csh scripting

unix%:~/tmp$ cat tmp.txt z=0.016728 NH=5.7E20 Center for spectra: 2:00:14.906, +31:25:45.826 I would like for the value of z to be set to a variable named $redsh, the value of NH to be $abun, and ...
user avatar
  • 313
0 votes
1 answer
3k views

Illegal variable name csh script

I need some help.I try to write csh script and I need to iterate through all files in current dir and do some tasks, so I wrote this: #!/bin/csh foreach f ($(ls)) if( some condtions) echo ...
user avatar
2 votes
1 answer
1k views

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

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 ...
user avatar
  • 301
5 votes
1 answer
10k views

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 ...
user avatar
  • 357
0 votes
1 answer
1k views

execute a script for each line of an input file

I have a txt file with 100 lines and 5 columns. I want to automatize a script, with reading the file each lines, make the first column the first argument, the second column the second argument etc. ...
user avatar
  • 357
0 votes
1 answer
53 views

putting two files into one

I have two files: one.txt with 108 lines and 10 columns and two.txt with 1 line and one column. I want to add the number in two.txt to each line of one.txt as the 11th column. What is the best option? ...
user avatar
  • 357
0 votes
1 answer
494 views

add a new column with a constant into a file

I have a file with 108 lines and 3 columns. I want to add each line a 0 (in the fourth column) in cshell. like from this 11443 225 3 1245645 22 3 18966 2975 3 ... to this 11443 225 3 0 1245645 ...
user avatar
  • 357
1 vote
2 answers
3k views

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 ...
user avatar
0 votes
0 answers
600 views

Unmatched '. in awk

I am running a script containing this code in Ubuntu: #!/bin/csh -f set file = $1 if ($1! == "" ) then awk '{ \ if ( NR == 1 ) NCOLS = $2; \ if ( NR == 2 ) NROWS = $2; \ if ( NR == 3 ) LL_LNG = $2; \ ...
user avatar
2 votes
2 answers
169 views

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 ...
user avatar
0 votes
1 answer
45 views

Where can I find a list of the features from Korn and C shells incorporated by Bash?

I would like to have some documentation about the features from Korn (ksh) and the C (csh) shells incorporated in the Bash command language interpreter. A exhaustive list of commands would be great. ...
user avatar
2 votes
1 answer
383 views

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. ...
user avatar
  • 1,201
1 vote
1 answer
2k views

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 ...
user avatar
4 votes
2 answers
20k views

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 ...
user avatar
1 vote
4 answers
5k views

Error while matching End of line with $ in Sed command

I am currently applying the below command in csh through a shell script. sed -i "s/cb $i$/cb $i $cb/" */callback_events Where: $i - Value of Variable i $cb - Value of Variable cb $ - To match the ...
user avatar
1 vote
1 answer
515 views

C shell script last command not working

I have this C shell (unfortunately C is required) script called EditFile.script consisting entirely of 6 different sed commands, all to be applied to one text file. #!/bin/csh -f 1i GameTime!!!!!!\...
user avatar
  • 405
0 votes
0 answers
153 views

Navigate through past commands in C shell?

For a certain assignment I am required to use a C shell. I already have csh up and going. However, I've noticed that usually when I press the up and down keys on bash terminal I see past commands I'...
user avatar
  • 405
2 votes
1 answer
527 views

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 ...
user avatar
  • 121
0 votes
2 answers
7k views

Unable to locate package "csh"

I tried installing csh, but it throws me the error: unable to locate package csh My Ubuntu version is 12.04.
user avatar
  • 1
0 votes
1 answer
111 views

Installing imod_4.7.15_RHEL6-64_CUDA6.0.csh in ubuntu

Can anyone help me with the installing of imod_4.7.15_RHEL6-64_CUDA6.0.csh software.imod is a image software,which I have downloaded from http://bio3d.colorado.edu/imod/download.html.I have extracted ...
user avatar
1 vote
2 answers
6k views

Floating point in CSH?

I have been trying to run this script, but it gives the error "badly formed number" due to the decimal 0.2224. If I replace it with any integer, the script works fine. #!/bin/csh -f set shift="-1 2 ...
user avatar
3 votes
1 answer
635 views

echo $SHELL: unexpected result [duplicate]

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 ...
user avatar
0 votes
1 answer
3k views

Problem with sudo apt-get update on Ubuntu 14.04 virtual machine

My problem began when I was tried to install the mmtsb (multiscale modelling toolset for structural biology) on an Ubuntu 14.04 Virtual Machine on a Windows Host. I tried giving the ./install.sh ...
user avatar
0 votes
1 answer
2k views

Odd Illegal Variable Name error in csh script

I have a peculiar problem with a csh script which occurs only in my Lenovo Z500 laptop. I have run the script in 3 other computers with analogous operating systems (Kubuntu 14.04 x64) and the only ...
user avatar
2 votes
2 answers
15k views

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 ...
user avatar
0 votes
1 answer
2k views

Setup: command not found. Cannot run installer

I'm installing Abaqus on Ubuntu. I have extracted the rar files into a directory. In terminal, I navigate to the directory and run the setup file using "sudo /directory_name/setup". Terminal gives me ...
user avatar
1 vote
1 answer
233 views

Is there an environment variable in csh to modify PS2?

Is there an environment variable in CSH to change the PS2 like in bash and sh? For example: $PS2 = "hi" I tried it but it doesn't work in csh.
user avatar
9 votes
2 answers
37k views

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/...
user avatar
0 votes
2 answers
2k views

How I can Install csh as a non-root user?

I need csh for installing a package but I am not root user... I want to install it for my user. I installed csh_20070713.orig.tar.gz, csh_20070713.diff.gz and csh_20070713-2ubuntu1.dsc But there is ...
user avatar
2 votes
2 answers
737 views

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 ...
user avatar
  • 1,696