Questions tagged [tcsh]

tcsh is an enhanced but completely compatible version of the Berkeley UNIX C shell, csh.

Quoted from the manpage:

tcsh is an enhanced but completely compatible version of the Berkeley UNIX C shell csh It is a command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax.

tcsh is the default shell on FreeBSD & DragonFly BSD, and was the default shell on earlier versions on Mac OS X.

Since tcsh is completely compatible with , almost all versions of csh encountered are actually tcsh.

Official site: http://www.tcsh.org/

704 questions
0
votes
2 answers

csh list of commands like ksh { list; }

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.
andreas buykx
  • 12,608
  • 10
  • 62
  • 76
0
votes
1 answer

Quoting a string for csh

For the purposes of this question, by "csh", I mean tcsh. I am aware of the standard advice to avoid csh for programming. However, sometimes ones needs to interact with existing csh code, and then it may be necessary to quote a string for csh. To…
Croad Langshan
  • 2,646
  • 3
  • 24
  • 37
0
votes
2 answers

Permissions when iterating over files in directory Unix TCSH scripting

I'm writing a script that will print the file names of every file in a subdirectory of my home directory. My code is: foreach file (`~/.garbage`) echo "$file" end When I try to run my script, I get the following error: home/.garbage:…
user1754045
  • 175
  • 1
  • 6
  • 15
0
votes
1 answer

overall page views driven by a referrer to one page (shell)

Having a log file in the standard combined access_log format of nginx or apache, how would you, in UNIX shell, calculate the number of visits or page views (i.e. total requests) from each visitor (i.e. IP-address) that a given referrer once…
cnst
  • 25,870
  • 6
  • 90
  • 122
0
votes
1 answer

sed: convert time(3) seconds in a table into printable date (spamdb)

I get the following from spamdb, where the third field represents the time in seconds since the Epoch. Cns# spamdb | fgrep…
cnst
  • 25,870
  • 6
  • 90
  • 122
0
votes
3 answers

Difference between where and which

What is the difference between the where and which command in Unix?
jarCrack
  • 106
  • 2
  • 9
0
votes
3 answers

Error converting a bash function to a csh alias

I am writing a csh alias so that I can use the following bash function in my csh : function up( ) { LIMIT=$1 P=$PWD for ((i=1; i <= LIMIT; i++)) do P=$P/.. done cd $P export MPWD=$P } (I stole the above bash…
Chani
  • 5,055
  • 15
  • 57
  • 92
0
votes
2 answers

How to create tcsh aliases using python?

I am trying to created aliases for tcsh from a python script (running Python 2.7.1). Once the aliases are created I want to use them in the same shell I ran the python script in. I tried: os.system('alias test "echo test"') but I get the following…
OHT
  • 15
  • 3
0
votes
1 answer

what are good resources to get the most out of csh or tsch?

I would like to get the most out of working in cch or tcsh shell. I am looking for general tips (post them away), online tips, or book. Thanks
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
0
votes
1 answer

For loop in terminal

I have a script which I need to run with many input combinations. Currently I'm doing it with a perl script but I want to learn how to do it in a shell. I need to run ./script.pl a b for all combinations of a=1..100 and b =1..100 for ($a = 1; $a…
leonsas
  • 4,718
  • 6
  • 43
  • 70
0
votes
1 answer

set commandline shortcut in tcsh for moving cursor by word

from How to move the cursor by word in command line of tcsh I know how to move cursor by word in tcsh, but they not easy to use, so can I set a shortcut on command line for example, when I use Ctrl+leftarrow, it actually works as Esc f?
wiswit
  • 5,599
  • 7
  • 30
  • 32
0
votes
1 answer

Error while running command from cron (tcsh)

When I'm running this command from shell(tcsh), it executes perfectly- cal | tail -6 | sed -e 's/^.\{3\}//' -e 's/.\{3\}$//' | tr -s '[:blank:]' '\n' | head -21 | tail -20 | tr -s '\n' ' ' | grep -w `date "+%e"` ; /usr/bin/bash -lc "if [ "$?" == 0 ]…
kaustav datta
  • 687
  • 2
  • 11
  • 31
0
votes
2 answers

Error running IF statement from shell

Trying to run an IF statement on two machines- 1.SunOS 5.8 Generic_Virtual sun4u sparc SUNW,Sun-Fire-V240 (bash) 2.SunOS 5.10 Generic_127112-11 i86pc i386 i86pc (tcsh) The command which I run from shell - if ( echo 13 | grep -w date +%e>/dev/null…
kaustav datta
  • 687
  • 2
  • 11
  • 31
0
votes
1 answer

execute tcsh command in bash script

In a bash script I need to execute this tcsh command. This command works fine in a tcsh command prompt but not in my bash script. eval `/app/modules/0/bin/modulecmd tcsh $variable` I have tried several things like adding /usr/bin/tcsh -c eval…
Fredrik
  • 299
  • 2
  • 5
  • 12
0
votes
1 answer

Opening multiple shells with tcsh script

Currently working with kde3.5 Here is what I would eventually like to do to help my workflow: Have a script that: Opens multiple konsole shells Renames each shell This is what I have so far: #!/bin/tcsh -fv set KPID =ps -ef | grep konsole | grep…
ctuley
  • 1
  • 2