Questions tagged [tcsh]

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

Filter by
Sorted by
Tagged with
2
votes
1answer
155 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
2answers
45 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 ...
0
votes
0answers
19 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
0answers
31 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 <...
0
votes
1answer
46 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 ...
0
votes
1answer
34 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 ...
1
vote
1answer
39 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 ...
0
votes
0answers
36 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 ...
0
votes
1answer
193 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 ...
0
votes
1answer
518 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' ...
1
vote
0answers
68 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 ...
2
votes
1answer
966 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-...
0
votes
1answer
890 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 ...
0
votes
0answers
245 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 ...
2
votes
1answer
536 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 ...
0
votes
1answer
127 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 ...
7
votes
1answer
1k 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 ...
0
votes
1answer
277 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 | ...
2
votes
1answer
375 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 ...
1
vote
0answers
51 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 ...
0
votes
1answer
110 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 ...
0
votes
1answer
81 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-;&...
2
votes
0answers
309 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
0answers
294 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 ...
2
votes
1answer
581 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 $...
1
vote
2answers
387 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 ...
1
vote
1answer
930 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
1answer
564 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 ...
2
votes
2answers
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,...
2
votes
2answers
392 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 ...
0
votes
1answer
67 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/...
1
vote
1answer
931 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 ...
0
votes
0answers
581 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 ...
0
votes
1answer
1k 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
3answers
193 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 ...
0
votes
1answer
771 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
1answer
424 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
1answer
1k 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
1answer
3k 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 ...
2
votes
4answers
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
2answers
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? ...
4
votes
2answers
25k 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 ...
0
votes
2answers
3k 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 ...
1
vote
1answer
111 views

How do I execute savehist for tcsh history if my machine froze?

My MacBook Air froze all of a sudden: the keyboard, trackpad and display are all unresponsive. However, ssh works. I have one tcsh session active. Which signal do I send to tcsh for it to ...
0
votes
1answer
3k views

No entry for terminal type "xterm-256color-256color

I recently added the following (below) to .mycshrc to allow 256 color xterm and allow command line vim to operate in 256 colors, however certain command line tools like less have thrown errors xterm-...
0
votes
2answers
2k views

Copying a template header to multiple existing files

I have a bunch of *.csv files that use headers. Right now the files have headers and the same number of lines of data. I need to erase the data in these files, so I figured I could just overwrite the ...
2
votes
2answers
442 views

How do I make an alias work when I need to invoke more than one binary in the same command?

Say I have two binary files: binary1 and binary2. Each of them has its own option set: options1 and options2. Users need to invoke a command that follows this structure: binary1 options1 binary2 ...
1
vote
2answers
3k views

Tcsh command history

I use tcsh and have the following in my .cshrc file. But the .history file is not updated as and when I execute a command. Is there anyway so that .history file is updated every time I execute a ...
0
votes
1answer
3k views

Writing a tcsh script to copy files specified in first argument to a specific directory

I'm trying to write a script in tcsh that will copy select files that I specify at the command line from one directory to another without having to write out the entire path of each file. Also, to ...
4
votes
1answer
3k views

Linux: How to eval the contents of STDOUT?

Consider you have a file with some sort of terminal command. How might each line be executed? Can you pipe the output of more into an eval? %> more ./foo.txt Edit: After some help/guidance ...