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...
Incredulous asked 6/4, 2014 at 13:39

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 ...
Butanol asked 1/4, 2010 at 20:4

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

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 ...
Hemispheroid asked 11/6, 2009 at 5:23

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...
Itemize asked 20/12, 2008 at 1:23

13

Solved

I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?
Lawful asked 20/8, 2008 at 13:38

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

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 ...
Stationery asked 10/10, 2011 at 16:38

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...
Bathyal asked 25/4, 2012 at 16:16

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...
Rationalize asked 31/3, 2011 at 11:59

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

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

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...
Epigenesis asked 8/5, 2010 at 11:6

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...
Hurry asked 30/1, 2009 at 18:50

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...
Accelerator asked 1/5, 2012 at 18:33

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
Peters asked 14/1, 2010 at 18:46

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...
Ylla asked 10/11, 2017 at 7:12

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
Consonant asked 9/10, 2009 at 14:55

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...
Holiday asked 1/5, 2017 at 19:22

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...
Abukir asked 25/3, 2014 at 16:6

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...
Chopfallen asked 15/8, 2013 at 10:43

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...
Negligee asked 19/10, 2013 at 20:11

© 2022 - 2025 — McMap. All rights reserved.