csh Questions

4

In bash, I use Ctrl + w to do so, but it is not working in my csh and instead of deleting a word, it is cleaning entire line. How to delete last word ? Although Ctrl + u is working fine in both cs...
csh
Burtburta asked 6/12, 2012 at 5:10

6

Solved

Sometimes I use same foreach operation with different target files in csh. If I can give foreach command in a single line, I could easily substitue the target file names to repeat the process.(I us...
Careerist asked 12/9, 2014 at 12:27

3

Solved

I want to have variable in tcsh to hold the usage info of my script, so in my script, whenever I write echo $usage, it will print my_script -h : -help -b : do boo etc`. Is there a way to do ...
Eichler asked 5/9, 2011 at 8:49

29

Solved

How can I determine the current shell I am working on? Would the output of the ps command alone be sufficient? How can this be done in different flavors of Unix?
Sememe asked 24/7, 2010 at 21:35

19

Solved

This is a follow-on question to the How do you use ssh in a shell script? question. If I want to execute a command on the remote machine that runs in the background on that machine, how do I get th...
Singleaction asked 26/8, 2008 at 22:55

4

I use Cshell and i'm writing an if else statement in oneLine. If statement executed successfully and else block is going for infinite loop and cannot exit back to promt. Any suggestion how it can...
Menarche asked 16/11, 2015 at 6:56

3

Solved

I am new to shell scripting and i am trying to remove new line character from each line using SED. this is what i have done so far : printf "{new\nto\nlinux}" | sed ':a;N;s/\n/ /g' remov...
Trihedral asked 16/5, 2012 at 12:43

3

I am using tcshand I am looking for a way responsive working directory where I at least want to display the last folder name instead of getting full path. Imagine my current working directory is :...
Platas asked 9/10, 2015 at 5:21

6

Solved

csh is an utterly horrible shell. (Making that statement up front to avoid the inevitable comments of "don't use csh", or perhaps I should just state that for the sake of any readers: please, if yo...
csh
Tarrant asked 26/11, 2012 at 18:22

5

Solved

I try to make a small script, using c shell, that will take a file made of several lines, each containing a name and a number and sum all numbers that a have certain name. How can I put into a vari...
Fustic asked 25/10, 2010 at 9:14

8

Solved

Having a long running program that continuously writes to a logfile - how is it possible, disregarding any buffering issues, to add a date string to each line written to that file using a linux scr...
Pie asked 16/6, 2011 at 16:53

4

Solved

How can I extract a word that comes after a specific word in Linux (csh)? More precisely, I have a file which has a single line which looks like this: [some useless data] --pe_cnt 100 --rd_c...
Qulllon asked 28/6, 2013 at 18:18

5

Solved

I have a simple script test.sh #!/bin/bash echo $0 When I run the following from csh terminal: bash -c 'test.sh' Then the output is test.sh But when I run: bash -c 'source test.sh' The ou...
Conlan asked 15/2, 2014 at 1:13

7

Solved

I have a csh script (although I can change languages if it has any relevance) where I have to: sed s/AAA/BBB/ file The problem is that AAA and BBB are paths, and so contain '/'. AAA is fix...
Glossographer asked 21/8, 2012 at 19:7

8

Solved

Say I want to iterate from letter A to letter Z in csh shell. How do I succinctly do that? In bash I would do something like for i in 'A B C ...Z'; do echo $i; done The point is I don't want t...
Hellfire asked 22/9, 2009 at 17:1

1

Solved

I would like to call different other scripts, depending on whether a paramter is given or not: "paramtest": "if [ -z $1 ]; then echo Foo $1; else echo Bar; fi", npm run paramtest should give...
Griseous asked 18/7, 2018 at 11:52

4

Solved

I have a script that is used to set some env vars in the calling csh shell. Some of those variables depend on the location of the script. If the file is a proper csh script, I can use $0 to access...
Pick asked 2/12, 2010 at 17:30

9

Solved

I want to get diffs on files in a specific pending changelist. I wish I could do this: p4 diff -c 999 Can someone help me string together some csh magic to make this happen? Maybe take the outp...
Nitz asked 13/7, 2009 at 19:27

11

Solved

Can you edit a shell script while it's running and have the changes affect the running script? I'm curious about the specific case of a csh script I have that batch runs a bunch of different build...
Rascal asked 3/8, 2010 at 15:49

3

Solved

I'm being put in charge of managing a bunch of servers, I want to set up my prompts on each of them so that I don't get confused as to where I am logged in to. I've edited my .cshrc files and put ...
Enthymeme asked 21/8, 2012 at 21:21

12

Solved

It is typical to have something like this in your cshrc file for setting the path: set path = ( . $otherpath $path ) but, the path gets duplicated when you source your cshrc file multiple times,...
Scold asked 25/9, 2008 at 20:16

2

Solved

I am trying to append a path to the end of my PERL5LIB environment variable, but I am not sure that this variable will always exist. If it doesn't exist I would like to simply initialize it to the ...
Catholicism asked 8/12, 2017 at 21:55

20

Solved

I'm trying to write a shell script that, when run, will set some environment variables that will stay set in the caller's shell. setenv FOO foo in csh/tcsh, or export FOO=foo in sh/bash...
Hurry asked 30/1, 2009 at 18:50

3

Solved

In CSH foreach loop or for loop, how can I add a loop iterator or counter which increases from 10 to 1000 with steps of 20? Something like foreach i (1..20..5) or for (i=1;i<20;i++).
Expect asked 22/2, 2011 at 19:57

2

Solved

I've encountered this code written in csh: if ( ! $?LM_LICENSE_FILE ) then setenv LM_LICENSE_FILE $_LmLicense else switch("$LM_LICENSE_FILE") case *${_LmLicense}*: breaksw default: setenv LM...
Ium asked 7/6, 2013 at 3:55

© 2022 - 2024 — McMap. All rights reserved.