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
4 answers

printing contents of a http file to a shell?

I want to be able to retrieve the contents of a log file stored on a server in the form of: http://[SOME SORT OF ADDRESS]/file.txt and print it to a shell which can refresh using something like 'watch' to keep a real time track of this log from a…
user1228368
  • 117
  • 1
  • 1
  • 5
0
votes
1 answer

Retrieve the last field in a string containing '/' as delimiter using tsch script

I have writen a tcsh script. I have a file name and its path in a variable. For example : proj/debug/runs/filename This path can be of any length. I need just the file name at the end. Is there any way to split this string and retrieve the file…
Ana
  • 3
  • 2
0
votes
3 answers

Identical shebang not working

So I'm trying to create some scripts that I want to run without manually specifying the interpreter each time I run it. #!/usr/bin/python Above is the shebang on an existing script that runs like I want it to. Below is the shebang of a script I…
Dhruv Govil
  • 349
  • 1
  • 3
  • 13
0
votes
1 answer

Shell Script and string operations

I am trying to write a script for Linux on tcsh. I have not written a script since maybe 98 on Unix and that was very basic stuff. I am trying to take a string and find sub strings in it. For example in a very long string that is a devices status…
Dixon Steel
  • 1,021
  • 4
  • 12
  • 27
0
votes
2 answers

tcsh: aliasing "which" breaks "which cd"

Many years ago, I did "which cd" and it told me "cd: shell built-in command." Recently, I tried it and got: /usr/bin/which: no cd in ([obscenely long path I will not reproduce here]) I investigated and found that someone had aliased which: >…
user354134
0
votes
1 answer

How to find from within a csh script whether a certain command is available?

In a csh script, I need to perform something only if a certain command is available. I wanted to do something like if( _WHAT_TO_PUT_HERE_ ) then # enter only if command "cmd" is in the path cmd ... endif how to do that in csh or tcsh?
Walter
  • 44,150
  • 20
  • 113
  • 196
0
votes
2 answers

Regarding the use of xargs in find command

I have one scenario where I need to select all files having aliencoders.numeric-digits like alienoders.1206 and find command should search all subdirectories too. If there is no such file it should not do anything. I wrote : find /home/jassi/ -name…
Jassi
  • 521
  • 6
  • 31
0
votes
1 answer

What does the -b argument do in csh?

I am looking at a tcsh script that has the following shebang line: #!/bin/tcsh -fb # then executes some commands What does the -b do? From the man page: -b Forces a ''break'' from option processing, causing any further shell arguments to …
andrewrjones
  • 1,801
  • 21
  • 25
0
votes
1 answer

How to execute the results of a pipe in csh?

I need to execute the results of a pipe, but without using a temp file (the pid needs to stay the same...dang screwy regression system). So, if I have a test file that contains: echo Do this I ideally want to run something like: cat test_file |…
SDGator
  • 2,027
  • 3
  • 21
  • 25
-1
votes
1 answer

Remove duplicate records from a csv file considering single column

I have a file with records in such a type- ,laac_repo,cntrylist,idlist,domlist,typelist 1,22DE17,BA,S6CD6728,24JA13,6A 2,12FE18,AA,S6FD7688,25DA15,7D 3,22DE17,BA,S6CD6728,24JA13,6A 4,12FE18,AA,S6FD7688,25DA15,7D I want to remove duplicate records…
Saurabh
  • 1
  • 3
-1
votes
1 answer

I can't interpret this tcsh script's function

I'm trying to interpret this tcsh code: echo -n '$ ' set x = $<:q echo $x:q set x = ( `echo _$x:q | sed 's/\<-/\\-/g;' | tr '[?*' '\r\v\b'` ) but I have no idea what :q means. There's nothing earlier in the script declaring q. Isn't the < supposed…
DanR
  • 7
  • 2
-1
votes
1 answer

How can I pipe data out from python output in terminal?

I get list of folders using os.listdir.. python -c "import os; print os.listdir(os.getcwd())" I want to pipe the output to a for loop in shell and iterate in tcsh shell to run a different command to which each folder can be used in…
Chang Zhao
  • 631
  • 2
  • 8
  • 24
-1
votes
1 answer

Cygwin - tcsh - Can't run Python script - Command not found

I am using the tcsh shell of Cygwin. I installed Cygwin because I have a prof giving a bunch of instructions in Linux/Mac and they are all using csh commands. When I type this: cat some_file.txt | some_python_script.py I get…
-1
votes
1 answer

What do the numbers in the tcsh history file mean?

What do the numbers in the tcsh history file mean? [root@localhost ~]# vi /home/test/.history #+1572853835 su 0- #+1572854170 history -a #+1572854172 history -w
-1
votes
1 answer

Defining shell environment variables in tcsh

Unable to create environment variables using a tcsh script. Tried set, but works only inside the script. setenv doesn't work outside the script. export says "command not found" in the terminal I'm trying to run. #!/usr/intel/bin/tcsh #set WV…
Alan Saldanha
  • 87
  • 2
  • 8