The csh tag has no wiki summary.
1
vote
3answers
64 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);
...
0
votes
2answers
40 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)?
0
votes
1answer
49 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" ...
1
vote
1answer
37 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 ...
1
vote
0answers
79 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
...
0
votes
1answer
69 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 ...
1
vote
3answers
68 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 ...
3
votes
2answers
448 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 ...
0
votes
0answers
41 views
How to handle a list as argument in CSH file?
I have - for example - the following command to execute my CSH job:
startPRE.csh 20120801,20120901,20121001
In the CSH script, I want to exectue a loop for every date in the list.
$1 = ...
0
votes
0answers
68 views
how do i set c-shell environment variables in tcsh shell script
i am trying to set the environment variables in tcsh shell and it is not working. This is the syntax that i am using currently
setenv MYSQL_HOME=/opt/mysql/mysql/bin
my other question is i have a ...
1
vote
0answers
257 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. ...
0
votes
1answer
224 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 ...
2
votes
2answers
512 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'
...
0
votes
2answers
830 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 ...
2
votes
1answer
355 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 ...
2
votes
1answer
921 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 ...
3
votes
3answers
611 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 ...
0
votes
2answers
609 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 ...
0
votes
1answer
481 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% ...
1
vote
0answers
239 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 ...
0
votes
2answers
397 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 ...
0
votes
0answers
60 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 ...
2
votes
1answer
926 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 ...
0
votes
1answer
145 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 ...
1
vote
1answer
159 views
How do I background a job quietly?
Using csh, how do I put a job in the background without generating any output?
[prompt] job &
[1] 5103
I want to eliminate the line [1] 5103
1
vote
1answer
213 views
On the command line, 'find' reports back an illegal time value
I want to run the following command.
find . -mtime -60s
When I do, I get this output instead:
CLIENT% echo `date +%s`-1308741881 | bc
5152
CLIENT% find . -mtime -`echo `date +%s`-1308741881 | bc`s
...
1
vote
1answer
468 views
csh cd alias: how to eliminate error when no parameter is supplied
I am familiar with bash, but my works require csh. in my .cshrc, I created this alias:
alias cd 'cd \!:1; ls -l'
It works very well except for one case: when I cd without any parameter:
cd
In ...
1
vote
2answers
241 views
What are the options to make csh behave more Windows-like?
I'm using csh via PuTTY from a Windows PC and since I'm used to having the HOME button just place the cursor at the beginning of the string (instead of inserting ~) or ctrl+arrow place the cursor at ...
2
votes
2answers
749 views
find files within a specific directory structure but a variable parent directory structure
I want to use the find command in linux to find a specific file nested within a specific directory structure, say dir1/dir2/reqdfile.
But this directory structure can itself be nested within any ...
2
votes
2answers
3k views
How do I add a location to my path in Unix?
I am new to Unix. I am using a default installation of FreeBSD, with the C shell (csh).
Suppose I have a command I can run by executing this: /sbin/abc, but cannot run by executing abc. How can I set ...
2
votes
1answer
526 views
How to set PATH to run programs outside of default path?
I'm working on a project on my school's linux servers. I have a program deep in a directory, we'll say it's ...
1
vote
2answers
837 views
How to open xterm shells with background colors based on topographic positioning?
I currently use an alias in csh/tcsh to open shells with specific window colors.
Example: xterm -geometry 105x25 -font 8x13 -bc -bg #333 -fg #999 \!* &
What I'd like to do is have one command ...
0
votes
3answers
782 views
run tcsh but bash started instead
I tried to start a tcsh on my Fedora 7 (default shell is bash)
[ss@ssvm ~]$ tcsh
[ss@ssvm ~]$ echo $SHELL
/bin/bash
As you see, another bash shell started.
I looked at the tcsh file:
[ss@ssvm ~]$ ...
0
votes
1answer
108 views
how to set up new keybinding for finding last command executed using the first few characters of the command in csh
I want to be able to use Ctrl+R to have reverse-i search. Also if I press Shift+Up Arrow after typing the first few characters of a recently executed command then the shell should complete the command ...
1
vote
2answers
857 views
How to start tab suggestions in csh?
In a different distro of linux I had bash tab suggestions enabled. Now I am using Konsole with csh on my pc. how do we enable tab completion in csh?
By tab suggestions I mean that if I type ...
1
vote
5answers
2k views
linux text editor for windows
can somebody recommend a good Linux text editor for Windows (if it exists), I wrote scripts for C-Shell using txt editor of windows but I have problem, it doesn't run because windows is not UNIX, what ...
0
votes
1answer
279 views
tcsh `cd` always issues a printout of `$PWD`. How do I disable this?
Someone in IT thought it would be a good idea to modify the default behavior of the command cd in our tcsh environment. As of Monday the "upgraded" version of cd always prints out $PWD after it ...
0
votes
1answer
822 views
getting error while doing cat command “Ambiguous output redirect.”
while executing
cat test.txt | java myfile > test1.txt 2> test2.txt
I am getting error "Ambiguous output redirect."
my java file contains System.out and System.err .
I am in Unix csh ...
5
votes
6answers
4k views
How do I set $ variables in unix?
For example there is a long path that I cd to very often. How do I store the path in a variable so that I can use it everytime?
For example: I wan to be able to do this
cd $path
instead of
cd ...
6
votes
4answers
7k views
Is there a way to escape single-quotes in the shell?
E. g. I want to say
perl -e 'print '"'"'Hello, world!'"'"', "\n";'
Is there a less awkward way to do it, e. g. escaping single-quotes?
Yes, I know that I can write
perl -e 'print q[Hello, ...