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 match the first /-delimited term to an actual subtree node, and then follow normal directory completion for any successive terms. It is sort of...
Hi,
In bourne-compatible shells, the { list; } syntax causes the complete list of commands to be read by the shell before executing it, without opening a new shell. Is there anything similar for the csh?
Thanks.
...
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
...
I would like my tcsh script to launch an editor (e.g., vi, emacs):
#!/bin/tcsh
vi my_file
This starts up vi with my_file but first displays a warning "Vim: Warning: Output is not to a terminal" and my keystrokes don't appear on the screen. After I kill vi, my terminal window is messed up (no newlines), requiring a "reset". I tried "...
hello
in unix command line !! will execute th eprevious command on the command line like below
indibm202 21: date
Tue Nov 10 17:38:13 IST 2009
indibm202 22: !!
date
Tue Nov 10 17:38:16 IST 2009
indibm202 23:
what is the command to execute the second previous command?
...
I use tcsh , and when Delete/End is pressed on cmd line, it simply shows up as ~ ; I have to press <Ctrl><e> to go to end of line. Can anyone help me to be able to use Delete/End keys as their name suggests ?
...
I use tcsh at work - one of the features I use extensively is command-line history completion at the shell prompt. Currently, I've limited the size of my history file to 2000 (as I don't want to slow down the shell too much). However at times I need a command I know I've used a month or two back , but by now has been erased. So I want a ...
I want to make an alias which would work like this:
vf hello.c would execute a find command to search for hello.c and open it in the vim editor.
What is the best way to do it? I've tried the following (doesn't work):
alias vf "find -name $* -exec vi {} \;"
alias vf "vi `find -name $*`"
Can anyone help ?
...
Hey fellas, I have this weird bug, and I have no clue how to fix it, would be very glad if you could help.
#!/bin/tcsh -f
set date = ${1}
set time = ${2}
echo 1
set month = `echo $date | cut -f1 -d"-"`
set day = `echo $date | cut -f2 -d"-"`
set year = `echo $date | cut -f3 -d"-"`
echo $date $month $day $year
echo $date $time
if ($year >...
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
...
I love and use vim daily on tcsh. I love everything about vim. And one of the reasons why I love it so much is I dont have to lift my hands to do stuff. I have jk mapped to Esc key in vim. But unfortunately, I cant get the same thing on tcsh shell.
Can someone help me bindkey jk to Esc on tcsh ?
Also please guide me to tcsh and vi-mode...
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 will return "/path/to/my_script.csh" - like ruby's
__FILE__
...
Hello,
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 is neccesary). The point is being able to do it only in shell without resorting to a program.
...
Hey,
I'm writing a shell script (tcsh) that is supposed to received 3 parameters or more. The first 3 are to be passed to a program, and the rest are supposed to be passed to another program. All in all the script should look something like:
./first_program $1 $2 $3
./second program [fourth or more]
The problem is that I don't know ...
I have a pov-ray file, which defines a lot of cylinders and spheres. Sometimes these shapes are defined to have "color@", which makes the povray unrenderable. One solution I've found is to delete the offending cylinders and spheres. So a file that contains this text
cylinder {
< -0.17623, 0.24511, -0.27947>, < -0.15220, ...
hello, I've got some problem, I have list of data in the file:
053-37878 03828008 Moskovitch James 500
052-34363 01234567 Mendelson Kippi 450
053-32322 03828008 Jameson Shula 350
054-39238 03333333 Merden Moshe 300
is it possible rewrite this list in the same file (without using temporary file) but without last number thanks in advanc...
I'm working with C-Shell, I'm trying to run this script
set callsTo = "`cut -d" " -f2 ${1}`"
echo $callsTo
cut receives data from the file which is the first parameter:
> ./myscript data
I need only second field from every row: -f2.
After that I want to check if the data was stored, but I receive or an error unmatched . or empty r...
somebody knows what does this error mean?
Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].
I receive this error after I enter in my script this row
#! /bin/tcsh -f
...
I'm trying to read first row from the file
> source ./rank file
using this script
set line = ($<) <- inside rank
but when I enter
echo $line I receive nothing, how can I change it? thanks in advance
...
can somebody explain me what does this error mean:
> ./rank lines.in
'nknown option: `-
Usage: tcsh [ -bcdefilmnqstvVxX ] [ argument ... ].
this is my script rank:
#! /bin/tcsh -f
set line = `cat ${1}`
echo $line
I think that the problem I have is with first row #! /bin/tcsh -f
I'm working on Windows! but after I wrote script on ...