Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [csh]

The C shell (csh), once one of the two major Unix shells with the Bourne shell. Csh had more advanced interactive feature but has been surpassed by modern Bourne-style shells such as zsh and bash.

0
votes
0answers
20 views

Assign temp file from cgi and read it in .sh [migrated]

I have .cgi file and .sh file. The cgi is calling the script which is the .sh file. How will assign the tempfile created from .cgi and pass it to the .sh file? Example below: (on my CGI, $tmpfile is ...
3
votes
1answer
35 views

How to use here document or assign multiline string to variable in csh?

I want to assign to variable to a multi-line string that contains a variable and then echo it. I attempted using here-doc as shown below. What is the best way to achieve this in csh? set my_name="...
0
votes
1answer
56 views

What does an '@' character mean in a csh script

I'm translating a csh script to bash an came across a line that looks like @ lines = `grep num_lines ../config.txt | awk '{printf("%d",int($2))}' ` What does the '@' do here? I found some ...
1
vote
2answers
39 views

Why can't tcsh do a single-line 'which -> vim' command?

I often have to do which command, and then open it in vim to actually see what's inside. I'd like to have an alias or function that does this, with tab completion. Here's what I've tried: superwhich()...
0
votes
1answer
35 views

How to customize .cshrc to configure command prompt?

Background Inspired by this question, I wanted to try to change my command prompt in this manner Enter this line into ~/.cshrc a. setenv PS1 "\[\e[32m\][\[\e[m\]\[\e[31m\]\u\[\e[m\]\[\e[33m\]@\[\e[...
0
votes
0answers
31 views

Add trailing slash in csh

How do I get csh to add a trailing slash at the end of tab autocompletion? eg: \stuff \otherstuff now if I type cd s and press tab, I get: \stuff and not \stuff\
0
votes
2answers
68 views

Comparing 2 files using awk , not getting any results - C shell

I am using c shell and trying to compare 2 files using awk . But the below awk statement doesnt give any result. Need to acheive this solution in awk using C shell. awk 'FNR==NR{a[$0]++;next} { {...
0
votes
1answer
40 views

Ambiguous error while executing ksh file

I have created a audit.ksh file which is used to clear old "*.aud" files. But when i run this file am getting below error. The strange thing is the commands inside the file works fine while executing ...
0
votes
1answer
44 views

error while using sed in tcsh alias

I am unable to "source/run" my tcsh alias, which is as below: alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/\!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'" ...
0
votes
2answers
70 views

How to retrieve prompt format string in csh / tcsh

My current prompt format string is generated by an outside script that is provided by the organization. I want to manipulate it a bit (add time to the string) for that I need my current format string. ...
0
votes
0answers
47 views

How to execute unix command after few background jobs?

My c-shell code has to complete few concurrent background jobs before execution of some unix commands. However, somehow in code my background jobs never returns handle to unix commands. i.e. $cmd1 | ...
1
vote
0answers
59 views

Linking issues with leptonica and libpng

Working through an install of tesseract without sudo permissions and without a standard bevy of prebuilt libraries. The installation I've got to go through as far as I know follows the path of zlib -> ...
1
vote
1answer
136 views

How do I cd and then ls in my cshrc

I want to be able to cd into a path and have it ls automatically. I have tried doing a function such as cs() { cd "@a" ; ls} but this results in an error saying "badly placed ()" so I do not think I ...
-2
votes
1answer
82 views

Linux (shell script) csh

I have a code that contain this line: set file = "" #empty what does it mean?
0
votes
1answer
353 views

C-Shell : variable in variable

I want the value of variabe ${var}_err_num, but i can't do it. #!/bin/csh -f set list = "book bus apple" foeach var $list set err_num * * @err_num = $err_num + 1 set ${var}_err_num = $...
0
votes
3answers
61 views

CentOS and Switching Unix Shells

I am using a VMWare Virtual Machine with CentOS installed. I am using BASH shell now but need to run an application that requires C Shell. Can a person just switch shells ? Will you need to ...
0
votes
1answer
43 views

umask does not have -S option

I'm trying to use umask -S to show the current mask in symbolic form (per man umask on my system, which gives me the page BASH_BUILTINS(1)). But umask doesn't seem to behave as the manpage claims: ...
1
vote
0answers
161 views

Convert date in this format to second [closed]

I need to determine when was the last login time from some login times i have. So! I have the date in this format : month as in Oct Sep Jan etc. then follows the day in numeric form 22, 23, 1... and ...
2
votes
1answer
382 views

OpenBSD - How does one set an alias?

I am running the latest OpenBSD and I cannot figure out how to set a simple alias, something along the lines of cls=clear. I've tried putting it in ~/.cshrc and in ~/.profile. I've tried: alias cls ...
0
votes
1answer
187 views

for loop logic porting from bash to csh

I have below code snippet working in bash: for i in `ps -eaf | grep -i <pattern> | awk '{print $3}'`; do kill -9 $i; done But I have a requirement to port this code to work in csh shell due to ...
1
vote
1answer
76 views

Program installation: Csh to Bash

I am trying to install xscore v1.3 (XSCORE MANUAL). They provide instructions to set up some environmental variables in the .cshrc file under C-shell. setenv XTOOL_HOME ...
1
vote
1answer
205 views

FreeBSD: Is the default user shell `tcsh`?

I was recently reading a tutorial for tcsh and it said that the default user shell for FreeBSD was tcsh and I was surprised. For FreeBSD, is the default user shell tcsh?
-1
votes
2answers
425 views

csh if statement interactive use

Either there's something fishy with my Solaris 10 csh implementation of if statement or I don't get something right (of course the second is very well probable in my case at least) but when I do: % ...
1
vote
0answers
32 views

How to automatically record all your terminal sessions with script utility using .cshrc [closed]

I have the exact same question previously asked here: How to automatically record all your terminal sessions with script utility But instead of using bash and .bashrc how would I write this in ....
-1
votes
1answer
51 views

How to check every file in directory and ask the user to do action in csh shell

The actions I would like to do with this script is to Read the name (without base) of each file in a directory For each file, ask the user if he wants to perform an action (e.g. move the file in a ...
0
votes
2answers
46 views

Directory tree listing, script does not work in csh?

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/' I found a command to display directory tree (see above), it didn't work correctly. It gave error message "...
1
vote
1answer
176 views

user resources csh.login restrictions

I need to fix a vulnerability in a RedHat 6 server: File /etc/csh.login must exist, and must trigger an invocation of source /etc/profile.d/IBMsinit.sh. I verified file csh.login is in /etc, but I ...
-2
votes
1answer
114 views

Why will “0.0u 0.0s 0:00.00 0.0% 0+0k 0+0io 0pf+0w” display on screen in csh [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 ...
-1
votes
3answers
1k views

How to change timezone in current shell session in Redhat

ls -lt shows time in PDT, I want to change it to Asia/Singapore in the current session. I tried set TZ=Asia/Singapore But it's showing the same time on ls -lt. How to do it?
0
votes
0answers
50 views

cshell text editor

Is there any text editor with highighting for cshell scripts that includes code folding? (Preferable something with a less steep learning curve than vim and emacs) I haven't been able to find ...
1
vote
3answers
211 views

get average for all numbers with irregular columns

all Can Awk deal with irregular columns? i.e. I have a file like below, each columns may have different number of values, how to get the average of all the positive values? Please note, the ...
0
votes
1answer
1k views

csh - check if $PATH variable contains a substring

Maybe I'm thinking about this wrong, but I want to add Python to my $PATH variable if it isn't already in there. Here's my code # Add Python to $PATH if(-e /path/to/python/bin && (! $PATH....
1
vote
1answer
108 views

How to avoid 'ambigous redirect' when executing command over ssh

I'm trying to execute a script on a remote server via ssh. the command should go to the background and continue to run after logout. The result of the command should be redireced to out.log on the ...
1
vote
1answer
964 views

export: command not found

I'm trying to install GAMESS (a computational chemistry package) on a Linux Mint machine and the config file has a #!/bin/csh at the beginning. When I run ./config the first line is export: Command ...
0
votes
1answer
348 views

sourcing csh script does not set the path variable without Bad subtitute

I am writing a simple script to source path variable as below: #!/bin/csh echo "setting path" set path=($path /sbin:/mscc/apps) However, the path variable does not change and remain the same. The ...
0
votes
1answer
1k views

read each line one at a time in csh

In bash, code like this will read each line in a file one at a time: while IFS=$'\r' read -r line || [[ -n "$line" ]]; do something done < "to-read-file" When the code is running, as long as ...
0
votes
1answer
77 views

How to force csh use local bin? [duplicate]

I'm only able to install new tool in my local directory. After ./configure --prefix=/local/directory, new tool is installed my local bin. But by default it's still point to the old version. How to ...
0
votes
1answer
78 views

Advanced aliasing for csh shell [closed]

I want to create an alias for the nedit command but with the ability to add a .txt automatically to the passed argument. For example, when I would type n newfile --> it should execute --> nedit ...
2
votes
3answers
4k views

Convert value from scientific notation to decimal in shell?

How to convert value from scientific notation to decimal in shell? (preferred C shell) Also I'd want to convert it from e-12 to e-9 and then shell 42.53e-12 to 0.04253. I have to do this for a list.
1
vote
1answer
50 views

Issues setting a variable to a string containing metacharacters, find, and another variable in csh

I'm using csh for a project (forced into it, sorry), and one component of my script uses variations of the following in a large block of its functionality: find . -maxdepth 1 -not -type d | awk '{...
0
votes
1answer
45 views

How to stop csh set from removing braces inside single quotes?

In the following code, it seems that {} are removed from inside single quotes when using set but not when using alias. How can I stop set from removing the braces? set variable = "middle" set string =...
1
vote
1answer
1k views

Login via ssh does not source the .cshrc file in my home directory (MobaXTerm Professional)

During my login to my Linux environment via ssh the .cshrc file in my home directory is not read. Each time I had to read this file after login via source ~/.cshrc I use MobaXTerm Professional 10.5 ...
1
vote
1answer
61 views

Creating a 'sub-screen', similar to how watch behaves [duplicate]

I have a Python script which generates a lot of different text outputs that require me to clear the screen quite regularly. The problem with this is that once the script is finished, I have a terminal ...
0
votes
2answers
146 views

Run command from history with parameters

Whenever I need to type a long command I find that the exclamation mark to refer to history very handy. For example, !ssh can be used to invoke the last ssh command I used. However I cannot get it to ...
1
vote
0answers
46 views

Why my VM is adding backslash on every backslash in recent command

My company setups a new VM for me to work and I'm not really sure the configuration details of this VM. One interesting thing which is new to me is that I get an annoying backslash on every backslash ...
0
votes
1answer
3k views

How to change Bash to csh with username and password

I want to change bash to csh I'm using following command which is not working chsh -s /bin/csh insite(user) insite(password). I need to write shell script with this command this is the output i got ...
1
vote
2answers
225 views

Syntax for `repeat` with a semicolon in the command string?

I'm keeping an eye on a process in FreeBSD using a script which outputs the current status of the job. Using the csh builtin command repeat, I'd like to run the script every 2 seconds, so naively I'd ...
-1
votes
2answers
470 views

Ambiguous input redirect error in csh

echo "yes" | my_program < input_file I'm getting Ambiguous input redirect error in csh. How to solve this?
2
votes
2answers
213 views

Setting paths for interactive C-shell

My default shell (on Ubuntu) is bash. However, for a particular programme I need to change to the C-shell. For this I have a .cshrc file set up, however, if I change interactively to the C-shell (I'm ...
1
vote
1answer
215 views

How to manipulate multiple file names using find?

How to improve the command below to change a string in a filename. find . -type f -name '*<today>*' -exec mv {} {}_renamed \; Actually I have a few files in my directory with today's date as a ...