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...
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...
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 ...
29
Solved
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...
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...
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 :...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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 ...
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...
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++).
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...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.