Questions tagged [csh]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
18 views

Pathname or word too long in Cshell

I am using cshell. And I know that there is a limit of 1024 character while setting path. But I have many path variables which I need to set. So, it is exceeding 1024 characters and I am getting an ...
Subhadip's user avatar
  • 111
2 votes
1 answer
2k views

How to set environment variables by calling a tcsh script that sources another csh script

I'm unable to set environmental variables present in a .csh using another .tcsh that is sourcing this file inside it: This does not set the environment variables: $PERC_PATH/bin/runperc.csh ...<...
Alan Saldanha's user avatar
0 votes
1 answer
402 views

How to do a recursive filename `find` from the shell using a glob pattern with "set braces"

From the shell, I'd like to recursively search a directory for a given glob pattern. But I want to use set-braces-syntax in my pattern: find ~/path/to/dir -name '*.{h,m}' Here I'd like to recursively ...
Todd Ditchendorf's user avatar
1 vote
1 answer
811 views

Bash prompt: How to invert text white-on-black instead of black-on-white like tcsh

I'm a current tcsh user and have this setting in my .tcshrc file to set the prompt: set prompt="%S MBP %s %~ [\!] " My screen's text is usually black text on white brackground, but the %S ...
stackoverflowuser2010's user avatar
0 votes
1 answer
154 views

I want to loop though each sub-directories & check if *.v or *.sv file is present or not , if it is present then do some operation using csh script?

NOTE : I have made an attempt to implement this below logic for each sub-directories. But not able to do so. #!/bin/csh -f setenv option $< switch ($option) cd $option foreach i (`ls`) pushd $i ...
Aakash's user avatar
  • 3
0 votes
2 answers
614 views

Customize csh prompt based on uid/superuser status

I'm trying to set up a condition where my csh prompt is customized to change username color and prompt character if I take on root privileges via "su". What's the most sensible way of doing this? ...
rudds's user avatar
  • 3
0 votes
1 answer
1k views

Package not found for awk.exe and csh.exe in Cygwin 2.10.0

I'm upgrading from cygwin 1.7.35 to cygwin 2.10.0. But I could not find any package that contains awk & csh binaries (.exe). When I type info csh or info awk in cygwin(2.10.0) terminal it shows ...
Mayank's user avatar
  • 1
1 vote
1 answer
7k views

csh: How to check if symbolic link exists?

Symbolic link was create by command ln -s. Tried if ( -e "$link" ) and if ( -f "$link" ). But it's not working.
Fisher's user avatar
  • 687
0 votes
0 answers
407 views

How to script to read user input, then run in background itself even closing terminal in TCSH?

I am looking for a strategy suggestion. I am very new to Linux shell scripting. Just learning tcsh not more than a month. I need a script to automatically detects when is the result files are done ...
Scout's user avatar
  • 1
2 votes
3 answers
8k views

How do I run a Python script from a C shell without specifying whole path?

I would like to run a Python script from a Hamilton C shell without having to specify the whole path of the script. The first thing I tried was to add my scripts folder to the PATH environment ...
Alexandre Vanier's user avatar
2 votes
1 answer
128 views

How to get piped output in color?

I am using FreeBSD with the csh shell. As an example, in the terminal / screen I get color output for ls (eg. ls -lGs). But when I pipe it through more (eg ls -lGs | more) the output has no colour. ...
Lexib0y's user avatar
  • 149
2 votes
1 answer
753 views

tcsh: how can we display the body of a foreach loop in history

I see that history doesn't display the body of loops. Is there a way to show them? san: cd /tmp/test san: touch abc san: touch def san: ls abc def san: foreach file ( `ls` ) foreach? echo "File is $...
SAN's user avatar
  • 335
1 vote
1 answer
13k views

What's the equivalent of .bashrc for CentOS?

By configuring ~/.bashrc as desired, each time the user logs into their bash shell the configured settings (of .bashrc) will automatically be set. Now I must be missing something but despite thorough ...
PhilPhil's user avatar
2 votes
0 answers
138 views

RHEL 6 converting a BASH script to a CSH script

I have a BASH script( running on RHEL 6 ) that brings up a GNOME terminal, opens multiple tabs in that terminal, starts a server in each tab, names the tab after that server, and inserts the command ...
user787832's user avatar
0 votes
0 answers
85 views

RHEL 6: GNOME: staring a *.desktop file in a shell different from the system default

I'm in RHEL 6 with bash as my default shell. I have a script called startServers I made a startServers.desktop file which I put on my desktop so I can have the convenience of clicking on an icon to ...
user787832's user avatar
0 votes
1 answer
55 views

Use of variables withing singlequotes, CSH

I have a short script meant to do some server maintinence, but I can't for the life of my figure out how to properly use variables within my script, Here's a code sample to make it more clear: --...
dusty's user avatar
  • 1
1 vote
3 answers
103 views

How to send the output of CSH script to a text editor?

I found a pretty cool CSH script at work that makes a frequently used query to Postgres a little more friendly --- except that it dumps the output to the shell. This is the part of the script ...
user787832's user avatar
1 vote
1 answer
2k views

How can we configure paths for .cshrc

Within a shell script, i am trying to open a new tcsh shell and load some set of pre defined aliases and env variables which i do not want to have in default cshrc. I cannot have it in my home dir ...
SAN's user avatar
  • 335
0 votes
0 answers
785 views

Run script on SSH login to server

I'm trying to work out how to get SSH to run a script before passing a shell to me. The reason for this is that I will be logging into shared users on many boxes and I want my own configuration when I ...
Doddy's user avatar
  • 1,018
0 votes
2 answers
500 views

What is the equivalent of pathmunge() in csh?

In bash, a common function implemented in e.g. /etc/bashrc is pathmunge(), which appends or prepends a path to PATH if it isn't already listed among the elements in PATH. Example: $ echo $PATH /bin:/...
clacke's user avatar
  • 308
1 vote
0 answers
402 views

What does the datasize limit in a csh actually do?

My .cshrc had set up a "limit datasize 256000", however several of my running processes are currently exceeding that. For example: VmPeak: 496840 kB VmSize: 496840 kB VmLck: 0 kB VmHWM: ...
Mutmansky's user avatar
  • 111
1 vote
2 answers
338 views

Why is `less` just showing the output of my title script instead of the file contents?

I'm using csh as my terminal and I have a script that runs when I change directories that replaces the window title with the current directory. I have it run initially in my .cshrc file as well so ...
Ben Richards's user avatar
  • 12.8k
0 votes
1 answer
457 views

Linux firing subshell and stopping whole script

How to make it work? #!/bin/csh newgrp user_grp2 echo ok "echo ok" is not executed until I write exit in the console. This is sample code. How to make it work? I ask in another way: when i run some ...
wcale's user avatar
  • 3
0 votes
2 answers
1k views

How to delete all files with filenames containing spaces on Linux? [duplicate]

cannot delete my own question, overwrite instead
user avatar
1 vote
1 answer
687 views

Change CSH shell keyboard shortcut

I want to set Ctrl-w to delete the previous word in csh (as it does by default in bash). How can I do this? Thanks
Opt's user avatar
  • 271
10 votes
2 answers
2k views

How to make auto complete available for directories in cdpath for tcsh?

I just learned the trick for setting up cdpath in tcsh and it looks pretty useful. However, it seems that auto-complete of sub-folder names doesn't come with it. Is there any trick available on that? ...
Derek's user avatar
  • 259
1 vote
1 answer
1k views

FreeBSD csh style history auto completion in bash

I am looking for a way to make it so that my ubuntu bash shell has the same kind of history completion as you get with csh in FreeBSD. The behavior is that on the command line if i start to type ...
Derek's user avatar
  • 685
6 votes
6 answers
2k views

Is it possible to open a file to a specific line number as formatted in grep -n results?

I often use grep with the -n option to list line numbers, e.g. $ grep -n xyz .* /ext1/acheong/foo/bar/a.cc:42: inline bool abc(int xyz); /ext1/acheong/foo/bar/a.cc:43: inline bool def(int xyz); ...
Andrew Cheong's user avatar
0 votes
2 answers
1k views

Execute a command with parameter each filename in a folder

I would like to execute a command, let's call it abc and add as a parameter each filename in the current folder. How could I do this in C Shell (or other scripting language)?
ddmichael's user avatar
  • 357
0 votes
1 answer
750 views

csh bindkey what is "\346"

It looks like I cannot use Ctrl+right_arrow to forward word on my c shell. After some effort I found out that the all the key bindings can be found with bindkey command and I get these: "\306" ...
user1861088's user avatar
1 vote
1 answer
3k views

Using different .cshrc.user files

I have two .cshrc.user files for two different projects. For example, they set the same environment variables but with different values. When I'm currently switching between projects, I run a python ...
Baz's user avatar
  • 489
1 vote
0 answers
2k views

csh: Every command returns "no match"

I'm on mac OSX mountain lion working with csh. I'm not quite sure what I did, but suddenly every standard unix command I run returns a "no match". Example: $ echo "Hello" echo: no match $ rm a.txt ...
smaccoun's user avatar
  • 111
2 votes
2 answers
1k views

Is there a command to make csh re-read all the directories in your path on FreeBSD?

I am having a weird issue in FreeBSD9 using csh as my shell. Newly installed programs that are in my path will only launch if I relaunch the csh shell. I find this really annoying. I guess csh ...
Warren  P's user avatar
  • 2,950
1 vote
3 answers
593 views

Using a session-specific .vimrc

I share accounts with other developers for test environments. The .vimrc on some of these accounts sets rows and columns, changing my terminal size, which drives me nuts. Is there a way I can set a ...
Andrew Cheong's user avatar
3 votes
2 answers
3k views

Transferring environment variable through SSH / quoting in bash/sh/csh/tcsh

I want to transfer an environment variable over SSH. The "correct" way is using SendEnv/~/.ssh/environment, but that requires the server to support AcceptEnv or PermitUserEnvironment, which it does ...
Ole Tange's user avatar
  • 4,779
11 votes
3 answers
56k views

What does ~ mean in a Linux shell?

I'm new to Linux and have been seeing this often. Could someone explain the concept here? ~/.somefilename What does the ~ (tilde) signify?
d-_-b's user avatar
  • 325
3 votes
3 answers
5k views

In csh/tcsh, how can I incorporate literal curly braces into a command that's processed with eval?

To give more details, the situation is this. I'm trying to prepare modulefiles (i.e., of the type used by the environment-modules package) to set up environment and aliases for third-party software. ...
Valtandor's user avatar
1 vote
1 answer
2k views

Gvim --remote to open file and focus on the newly opened file

I got a fairly old gvim (6.3) on CentOS 4.5. There's no --remote-tab-silent option yet. Instead, I use --remote to open file in same gvim instance. However, there's a problem that all files are ...
Stan's user avatar
  • 7,235
4 votes
2 answers
3k views

Unix "time" command with pipeline prints no time-report

Of the two C-shell aliases below, only the first prints the time command's report of elapsed time. How can I get the alias with the pipeline to also print the time report? alias make1 'time make' ...
Stan's user avatar
  • 7,235
1 vote
2 answers
21k views

Customizing CSH prompt

I'm using the directions here to customize my CSH prompt. Here's what I'm using: set prompt="\n%{\033[1;32m%}%m %{\033[36m%}${cwd}$ %{\033[0m%} " First of all, the ${cwd} part isn't giving the full ...
gsgx's user avatar
  • 1,033
3 votes
1 answer
1k views

Bash alias history substitution similar to \!* in csh

My question is very similar to that of this old post. I would like to do something similar: place in an alias the last argument(s) typed on the current command line. This would be equivalent to the ...
bossNova's user avatar
5 votes
1 answer
13k views

How to write a setevn/export script that will work in both csh and bash?

In my environment (RHEL) I have a bunch of script that are written in either csh or bash. Some of them are used to deal with a tomcat server. I want to keep the definitions of CATALINA_HOME and ...
Anthony Kong's user avatar
  • 5,018
5 votes
3 answers
8k views

How to run a process and completely detach it of its parent shell [duplicate]

Possible Duplicate: Leave bash script running on remote terminal while not logged in? How do I detach a process from Terminal, entirely? I'm running a program on a linux server that will take ...
Benoit Duffez's user avatar
0 votes
2 answers
5k views

"Command not found" error when running program

I'm trying to run a program, and keep encountering a "Command not found" error. I've checked that the appropriate directory is in $PATH, and that the file itself has execute permissions. I've tried ...
dckrooney's user avatar
  • 105
0 votes
1 answer
1k views

Why do I get a different behavior of the scp command in csh and bash?

Why do I get a different behavior of the scp command in csh and bash? Same command is working in csh shell, but it not working in bash shell. Please can anybody help? bash-3.2$ csh Linux-007% scp ...
user87005's user avatar
  • 179
3 votes
0 answers
585 views

Converting csh or tsh scripts to Bash

I am looking for a tool that can convert scripts written in csh or tcsh to a bash scripts. At least on the basic stuff so that I don't have to go through the process of translating everything from ...
Flethuseo's user avatar
  • 979
0 votes
2 answers
2k views

csh script to return number of process running

I want to set the number of a particular process that are running to a variable. The first line of the csh script below is the problem as it sets the variable "number" as ps aux | grep -c fiji ...
sebastian's user avatar
0 votes
0 answers
72 views

Sorting a list of directories that contain numbers with a different number of digits [duplicate]

Possible Duplicate: In bash, how to sort strings with numbers in them? We have the following directory structure on our file-system: ver30 ver20 ver50 ver70 ver100 ver90 I want to create a ...
RonK's user avatar
  • 1,520
4 votes
1 answer
8k views

csh: how to test for blank correctly?

I want to test if a variable is totally empty in csh. set R='dddd aaa' if ( '${R}' ) then echo not empty else echo 1111 endif However it apparently does not work. It gives this error ...
Anthony Kong's user avatar
  • 5,018
0 votes
1 answer
317 views

Please explain the behaviour of the shell (supposed to be csh)

On my Linux box, echo $SHELL results in /bin/csh. So I assume my default shell is c-shell. I am trying to understand the behavior of a shell script. scenario 1 - script contains - echo $1 $2 $3 echo $...
Sumod's user avatar
  • 105