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
2answers
47 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
43 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
47 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
74 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
70 views

Linux (shell script) csh

I have a code that contain this line: set file = "" #empty what does it mean?
0
votes
1answer
207 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
59 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
40 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
128 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
288 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
135 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
54 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
174 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
261 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
29 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
41 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
43 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
144 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
107 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
45 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
199 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
919 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
101 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
869 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
301 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
0answers
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
69 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
0answers
216 views

csh: history command numbers out of whack

I'm forced to run csh and I'd like to accomplish two things: Merge command history between multiple sessions and have the history available across all sessions (not just after logout). Format the ...
0
votes
1answer
72 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
3k 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
49 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
954 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
58 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
143 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
45 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
209 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
399 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?
3
votes
2answers
193 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
211 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 ...
1
vote
3answers
16k views

How to use while loop in csh shell command prompt?

I am trying to use while loop in csh shell command prompt in RHEL 7.2 but am getting the below error: $ while true while: Expression Syntax. The same is working in bash shell.
0
votes
3answers
1k views

How to replace one line with two lines using sed in csh on BSD?

I have a very simple text file here with the following contents line1 line2 line3 line4 I want to modify the contents via sed(or some other app) so it becomes line1 line2 #this line was added by ...
0
votes
1answer
414 views

ssh command in background

Please help in following. I am doing ssh user@server "source script.csh" from my home server Let us suppose script.csh contains 10 commands : 1st to 3rd command runs instantaneously 4th command ...
0
votes
1answer
141 views

Assigning / evaluating concatenated variables in tcsh

I have a tcsh puzzle, and would appreciate any help. When I run: set faceAttenRuns = (09 13) set run = $faceAttenRuns[1] echo $run This returns: echo 09. Great. But when I run: set runTypes =...
0
votes
2answers
403 views

Passing in special characters from a perl script to csh

I'm writing a perl script that takes a string and passes it into a .csh script. PerlScript.pl: $CMDLineArgs = "-stuff -more_stuff \'-even_more \"*stuff\" -last_stuff\'"; system(Script.csh $...
0
votes
1answer
2k views

How to create alias with variable in .cshrc?

For example, I want to create an alias to remove duplicate lines: alias rm.dup 'perl -ne 'print unless $dup{$_}++;'' When source .cshrc, it reports: "dup: Undefined variable." If change it to ...
0
votes
0answers
34 views

In Bash, the `*` is no longer expanded before passing into a command? [duplicate]

Is it different from C-shell? I remember in C-shell, when we do echo * then the * is actually expanded by C-shell to all filenames in the current directory, so echo really doesn't need to do ...
0
votes
2answers
342 views

Unable to redirect standard error of openmpi in csh to file

I have read this question and answer - Redirect stderr to stdout but nothing seems to work to capture the error of a software called OpenMPI on Ubuntu 16.04 LTS. I have the OpenMPI commands in a ...