tcsh Questions
6
I try to save history in tcsh after every entered command instead of saving it just after the "exit" command. This is because usually I open around 10 tabs at the same time and after it I just clos...
5
Solved
Say I put an executable tcsh file in /path/to/my_script.csh
and my current directory is anywhere, for example I'm in /path
So I type to/my_script.csh
I want to have a line in my_script.csh that ...
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
9
Solved
I have the following alias in my .aliases:
alias gi grep -i
and I want to look for foo case-insensitively in all the files that have the string bar in their name:
find -name \*bar\* | xargs gi ...
6
Solved
I'm trying to run the following commands:
replace -x "must " A2input.txt
replace -x " a" -f -s ## A2input.txt
replace -x to -s ## -a A2input.txt
replace -x faith -f "unequivocal" A2input.txt
And...
13
Solved
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 :...
5
Solved
I've been looking around for ways to alias clear and ls into one command.
Currently I've defined command x:
alias x="clear;ls"
Now is there any walkaround to avoid recursion and define:
alias ...
7
Solved
I am wondering what's the easiest way to check if a program is executable with bash, without executing it ? It should at least check whether the file has execute rights, and is of the same architec...
5
Solved
Is it possible to pass command line arguments to shell script as name value pairs, something like
myscript action=build module=core
and then in my script, get the variable like
$action and pro...
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...
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 ...
14
Solved
I would like to generate a random filename in unix shell (say tcshell). The filename should consist of random 32 hex letters, e.g.:
c7fdfc8f409c548a10a0a89a791417c5
(to which I will add whatever...
3
Solved
I'm having some trouble to understand how I can do some cleanup when the container is stopped.
To make it easier, I prepared a sample to reproduce the problem.
Here are the contents of my files:
...
Kliber asked 2/3, 2017 at 19:22
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...
8
Solved
I know that in the unix world, if you edit your .profile or .cshrc file, you can do a source ~/.profile or source ~/.cshrc to get the effect on your current session. If I changed something in the s...
2
I want a quick way to open the last modified file in the directory, perhaps in a form of alias.
Currently, I do ls -ltr. Then copy-and-paste the filename
Assume that I am using tcsh
1
Solved
I usually use csh (actually my /bin/csh is linked to tcsh, an improved version of csh) and frequently use !$ to refer to the last argument of the last command.
But sometimes I would like to use the...
4
Solved
coming from bash shell, I missed on an easy rolling of loops (for i in (...); do ... done;)
Would you post typical one-liners of loops in cshell?
ONE LINERS PLEASE, and not multiple-lines
thx
5
I'm trying to set up directory completion in tcsh and/or bash (both are used at my site) with a slight twist: for a particular command "foo", I'd like to have completion use a custom function to ma...
Dimitry asked 7/10, 2009 at 2:49
2
Solved
I get a "Illegal variable name" error for the following piece of line in one of my shell scripts -
"$WORKING_DIR"/sendEmail.py "$TEST_STRING, Tests passed" "$(cat "$WORKING_DIR"/logs/"$THE_PACKAG...
3
Solved
IF I have to check that if a variable is empty or not for that in bash shell i can check with the following script:
if [ -z "$1" ]
then
echo "variable is empty"
else
echo "variable contains $1...
3
Solved
I have file names that look something similar to this
name_1.23.ps.png
or
name_1.23.ps.best
or
name_1.23.ps
I want to take off the random file extensions on the end and be left with just...
2
Solved
In Unix (tcsh), I've referenced command line arguments in my aliases with two different notations - $1 and \!:1.
But I noticed that if I try to save $1 to an environment variable, it doesn't get s...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.