Questions tagged [tcsh]

tcsh is a Unix command shell based on the C shell (csh)

Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

'find' command giving error in script but not in command line

I have a simple file as below. When I key-in each command in the shell, it works but when I compile them in a script, it doesnt - produces error - no file or directories found , shown below I cant ...
0 votes
0 answers
12 views

Why am I getting this error with 3dDeconvolve when I run my AFNI script on an Ubuntu bash shell?

I'm trying to run a variation of the doDecon.sh AFNI script in the OpenScience_Scripts repository that will process the functional neuroimaging data for each of three tasks I am analyzing separately, ...
1 vote
1 answer
546 views

How to set environment variables by calling a tcsh script that sources another csh script

I'm unable to set environmental variables present in a .csh using another .tcsh that is sourcing this file inside it: This does not set the environment variables: $PERC_PATH/bin/runperc.csh ...<...
0 votes
1 answer
209 views

Disabling bracketed paste mode in Anaconda-Python REPL on Mac

There is one thing I can no longer do on my Mac: Type a bunch of Python in my text editor, launch the Python environment from the command line, and paste a few quick commands into the interpreter. ...
  • 113
0 votes
0 answers
12 views

Opening emacs in the background automatically on tcsh

I can get this working in bash and zsh, but my applications require me to be in tcsh. How can I get this working in tcsh? When I do the emacs () {"command emacs "$@" &}, it says ...
0 votes
0 answers
77 views

Run sudo su and tcsh from a script to change the terminal

Whenever I putty into one of our Linux VMs, I run: sudo su - serviceid tcsh bindkey -k up history-search-backward bindkey -k down history-search-forward The serviceid changes depending on what server ...
1 vote
1 answer
242 views

Bash prompt: How to invert text white-on-black instead of black-on-white like tcsh

I'm a current tcsh user and have this setting in my .tcshrc file to set the prompt: set prompt="%S MBP %s %~ [\!] " My screen's text is usually black text on white brackground, but the %S ...
2 votes
1 answer
793 views

Using "source" to set up aliases in WSL 2 using Ubuntu and tcsh

I am exploring the use of WSL 2 for Windows 10, version 2004. My preferred shell is tcsh, which I've installed. I am now trying to set up my usual aliases by placing them in a file such as .tschrc ...
0 votes
2 answers
103 views

Why is the output of word count not accurate when assigned to alias?

I use squeue to display jobs like below and I would like to count the number of running jobs (according to the fifth) column. The command squeue -h -u $USER | awk '{print $5}' | grep R | wc -l does ...
  • 169
0 votes
0 answers
22 views

Setting many variables written in a file to set in the environment of Shell at a time?

I have written many variables to be set as environement variables in a file , how should i set them all at a time . Sample Code in File : BRUN_ABORT_DEPENDENT_JOBS_ON_NONZERO_EXIT="true"; export ...
0 votes
1 answer
108 views

How to exit less follow mode without exiting less when xargs is used?

ls -rt *.log | tail -1 | xargs less +GF I use this command to tail -f my logs, but when I ctrl+c to exit follow mode, it quits less too. I think it is caused by xargs, because if you just less <...
  • 221
0 votes
1 answer
254 views

SSH sends environment variable, but to no effect

I'm SSH'ing from Cygwin into an older SUSE machine. I use: MyHost SetEnv FOO=bar SendEnv BAZ in my ./ssh/config file, and run export BAZ=bar on my Cygwin machine before connection. When I ...
  • 7,962
0 votes
1 answer
50 views

How to make tcsh command correction more sensible?

tcsh command correction (the behavior enabled by set correct = cmd) has an annoying "feature" that I'd like to disable: if I execute a program, but have another program with the same name "nearby", it ...
  • 101
1 vote
1 answer
119 views

screen - move cursor to beginning of line *in tcsh*

I am a screen noob. I also prefer to use tcsh. I cannot figure out the shortcut for getting to the beginning of the line (e.g. control-a). When I try to suggestion here: screen - move cursor to ...
  • 155
0 votes
0 answers
62 views

tcsh closes file descriptors

I have a program that is being launched with a tcsh script. I would like to communicate with that process trough pipes (not named pipes) created by a parent process. However, it looks like tcsh closes ...
  • 165
0 votes
1 answer
399 views

Usage of the percentile operator in shell scripts

In this link: https://superuser.com/a/180252/401901 The following command is used: cat list.txt | xargs -I % echo cp % new_folder What does the % % usage mean? All google search results are about ...
  • 1
0 votes
1 answer
800 views

Execute a command in new interactive tcsh shell

How can I execute a pre-command in a new tcsh interactive shell? Ex: For mimicking bash -O globstar in tcsh we can do set globstar. However, I need to start a new tcsh shell with 'set globstar' ...
  • 134
1 vote
0 answers
81 views

How to modify the behavior of the commands that delete "words" to the left

I've recently tried switching from being a long time tcsh user to bash and I was lamenting the extra key tapping for deleting "words" to the left, so I've been looking into modifying the behaviors in ...
  • 155
2 votes
1 answer
2k views

ssh-copy-id to a tcsh on Solaris?

Im trying to copy a public key to the ~/.ssh/authorized_keys file on a Solaris server. It fails with this error message: $ ssh-copy-id -i ~/.ssh/id_rsa.pub <USER>@<HOST> /usr/bin/ssh-copy-...
  • 121
0 votes
1 answer
1k views

Package not found for awk.exe and csh.exe in Cygwin 2.10.0

I'm upgrading from cygwin 1.7.35 to cygwin 2.10.0. But I could not find any package that contains awk & csh binaries (.exe). When I type info csh or info awk in cygwin(2.10.0) terminal it shows ...
  • 1
0 votes
0 answers
325 views

How to script to read user input, then run in background itself even closing terminal in TCSH?

I am looking for a strategy suggestion. I am very new to Linux shell scripting. Just learning tcsh not more than a month. I need a script to automatically detects when is the result files are done ...
  • 1
2 votes
1 answer
713 views

ypchsh not changing to some shells

I am currently in bash but I want to change my shell to tcsh. I used ypchsh, entered my password when prompted and then changed the login shell to /bin/tcsh. And it seemed like it worked because I get ...
  • 33
0 votes
1 answer
179 views

How to turn off directory echoing in tcsh?

Same question as this one but for tcsh. Since my latest OS upgrade, the built cd command in tsch echoes its path argument. This makes me think there is an error since I am used to that success is ...
  • 3,260
7 votes
1 answer
2k views

Does bash have a hook to determine when child shell exits?

In bash I spin up a t/csh shell, which updates the tty input (stty erase ^H) in the .cshrc, but when exit-ing and returning to bash the backspace key no longer works. This is because bash uses ...
  • 455
0 votes
1 answer
340 views

How to create command to send me text message as to whether it failed or passed?

I am trying to create a command that will send me a text message whether it passed or failed. So far my command looks like this: command && echo OK || echo Failed | echo ' 'at `date | ...
  • 121
2 votes
1 answer
408 views

How to automate git tasks that require a commit message?

I'm writing a script to automate a Git task. Doing this manually, there are a few points where git opens vim to edit a commit message, and I have to type :wq. Is there a way to pre-send these ...
  • 125
1 vote
0 answers
55 views

Tab-Complete (alphabetically) last match

We have a setup where jobs are dispatched and their results stored in directories with the same name but different trailing time stamp; eg.: result_20170111T090200 result_20170111T130500 ...
  • 121
0 votes
1 answer
119 views

Can I configure my .cshrc to ignore all files with a certain extension?

For the most part, I really don't care whether *.pyc files exist. I don't want them to show up when I do ls. I don't want them to be part of tab-completion. Basically, I want my shell to treat them ...
  • 125
0 votes
1 answer
94 views

How do I insert the results of a unix command into the tcsh CLI?

I often find myself wanting to create datestamped files and folders. For example, I'd love to be able to create a folder with a yymmdd datestamp called "160408-projectA" by typing: mkdir <ctrl-;&...
  • 11
2 votes
0 answers
364 views

Color coded 'ls' under ssh connection from Mac to SunOS server (tcsh shell)

I'm on a Mac under OSX. I ssh into a remote server which is running SunOS. The default shell under the remote server is tcsh, not bash. How can I set the ls to generate color coded output as I have ...
1 vote
0 answers
362 views

How to make an interactive subshell in tcsh?

How can I make an interactive subshell in tcsh? E.g.: % alias pathfrom 'cd `pathto -f`' ... where "pathto" is a script that asks the user (via STDOUT) for input (via STDIN) and prints a string in ...
  • 11
2 votes
1 answer
677 views

tcsh: how can we display the body of a foreach loop in history

I see that history doesn't display the body of loops. Is there a way to show them? san: cd /tmp/test san: touch abc san: touch def san: ls abc def san: foreach file ( `ls` ) foreach? echo "File is $...
  • 335
2 votes
2 answers
444 views

bash like --init-file in the tcsh

The bash/screen scenario: screen -dmS sessionname -c /path/to/screenrc the /path/to/screenrc contains for example screen -t windowtitle1 bash --init-file /path/to/window1.bashinit screen -t ...
  • 867
1 vote
1 answer
1k views

Red Hat 7 terminal does not open in cwd

I just got upgraded to Red Hat 7 and am getting used to the changes. One thing I immediately noticed was that when I press Ctrl-Shift-T to open a new terminal tab, it defaults to / rather than the ...
1 vote
1 answer
638 views

256color terminal flickering in Konsole

I'm trying to setup 256 color mode at work for my Vim setup and it just refuses to work correctly. I'm using Konsole as my terminal emulator and my shell type is tcsh. I found a perl script named ...
  • 11
2 votes
2 answers
1k views

Run tcsh with arbitrary startup script

I want to create a new instance of tcsh and source an arbitrary script, all in one step. The problem is that when I use the -c option, the shell instance closes as soon as the script is complete. So,...
  • 467
2 votes
2 answers
456 views

How to set a time length of ssh and redirect the error message

I have a hostlist and there are several hosts. I want to use ssh to connect to them. I want to see whether the host is available or not by the time length of ssh takes. If it take long than 5s (which ...
  • 21
0 votes
1 answer
70 views

tsch: tab-complete filename after --flag=

One the small annoyances I have in my daily use of tcsh is when I start writing a command like this: # do_stuff --input=/path/to/some I wish to use tab-completion to finish writing /path/to/some/...
  • 105
1 vote
1 answer
1k views

How can we configure paths for .cshrc

Within a shell script, i am trying to open a new tcsh shell and load some set of pre defined aliases and env variables which i do not want to have in default cshrc. I cannot have it in my home dir ...
  • 335
0 votes
0 answers
696 views

Run script on SSH login to server

I'm trying to work out how to get SSH to run a script before passing a shell to me. The reason for this is that I will be logging into shared users on many boxes and I want my own configuration when I ...
  • 1,008
0 votes
1 answer
2k views

I have a ~/.cshrc file that is sourcing another file, which should source an additional file but is not

I recently inherited an administration role for my lab and I'm still fairly new to this... so hopefully this question makes sense. Our system is set up so that one server hosts the data/user ...
1 vote
3 answers
306 views

Copying multiple files on linux

I have a linux machine with folders named numerically. How can I securely copy ranges of these folders to another server? The source machine runs tcsh, the target bash. At the moment, from the ...
  • 137
0 votes
1 answer
979 views

How can I make printf print unicode characters saved in a variable?

I have this code to print a horizontal line using unicode character \u2501: #!/bin/tcsh set horz_line = "'" foreach x (`seq 1 1 80`) set horz_line = "${horz_line}\\u2501" end set horz_line = "${...
0 votes
1 answer
515 views

Variable substitution in tcsh

Need your help. I've gone through the manual for the tch but still can't figure out how it should work in my case or whether it should work at all. I basically need to extract part of the variable ...
0 votes
1 answer
2k views

grep: Invalid back reference for date expression in tcsh

I googled for the following error, and didn't get any great explanations as to what was going on with grep under tcsh. (Yes, that date expression exists in the log files). $ grep '2014-07-21' *.log ...
3 votes
1 answer
4k views

Use ">>" Redirection Operator for Non-Existent File In tcsh/csh

I'm writing tcsh scripts and I would like to append to a log file, but if the log file doesn't exist before appending to it, I get an error (reproduced below). In bash the file gets created if it ...
  • 135
2 votes
4 answers
2k views

rm matching file names by pattern

I have 42000+ Project Gutenberg epubs. Often a release has both an images version and a no-images version. I want to remove the no-image copies if there is an image copy. ... pg16045-images.epub ...
10 votes
2 answers
2k views

How to make auto complete available for directories in cdpath for tcsh?

I just learned the trick for setting up cdpath in tcsh and it looks pretty useful. However, it seems that auto-complete of sub-folder names doesn't come with it. Is there any trick available on that? ...
  • 239
6 votes
2 answers
33k views

Running commands as another user on their machine via ssh?

As part of my normal workflow I ssh into another user's machine, switch user to them, run a command, then exit out to my own machine again: ssh hostname sudo su user runcommand exit exit Is there a ...
  • 63
0 votes
2 answers
4k views

Suppress 'Warning: no access to tty' in ssh

I have a short simple script, that compiles a .c file and runs it on a remote server running tcsh and then just gives back control to my machine (this is for school, I need my programs to work ...
  • 111