Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tcsh]

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

0
votes
1answer
47 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
0answers
25 views

changing the environment to start a software

I have downloaded a software and want to change the environment of my computer such that when I write the name of the software, the downloaded software opens. The download directory is: /home/abc/...
0
votes
1answer
99 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
51 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
327 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
212 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
75 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
290 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
65 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
895 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
231 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 | ...
1
vote
1answer
204 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
49 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
74 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
69 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
262 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
238 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
467 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
309 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 ...
0
votes
1answer
586 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
432 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
738 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
322 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
41 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
620 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
534 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
793 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
97 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
628 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
317 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 ...
2
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 ...
1
vote
4answers
871 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
1k 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? ...
2
votes
2answers
18k 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
107 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
2k 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
1k 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 ...
1
vote
2answers
340 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
2k 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
2k 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
2k 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 ...
0
votes
0answers
58 views

Use two different completions in tcsh

I want to make a tcsh completion that completes with both a relative directory (ie p/*/d/), or the output of a command (ie p/*/'completionterms'/). Is this possible? Looking at the tcsh man page it's ...
2
votes
1answer
44 views

List directories without erroring if none exist

I have a rather strict set of specs for a directory listing that I need: It must list the directories in the current directory It must list purely the basename (no "./", no trailing slash) It mustn't ...
2
votes
1answer
1k views

Echo string in tcsh with special characters escaped

Is it possible to echo out a string in tcsh such that it is fully escaped, as tcsh would understand? In the same way as printf %q works in bash: % # Create a variable containing a tab character % ...
3
votes
1answer
3k views

How to get rid of errors when running find command in Linux?

I am using following command to list out 20 large files in a directory. But along with the file listing, it also shows error messages, such as permission denied. I tried adding 2> /dev/null but it ...
2
votes
1answer
602 views

Arbitrary code execution in tcsh prompt?

I'd like to customize my prompt to include the output of an arbitrary command, like you can do in bash (e.g., I'd like to cat a file and have its (one-word) contents appear in the prompt, or show the ...
1
vote
0answers
1k views

csh: Every command returns “no match”

I'm on mac OSX mountain lion working with csh. I'm not quite sure what I did, but suddenly every standard unix command I run returns a "no match". Example: $ echo "Hello" echo: no match $ rm a.txt ...
8
votes
3answers
723 views

vim can not execute unix command with :! due to shell changing

Our company uses red hat linux system and allocate everyone an account in /home. Unfortunately, our system is using tsch, which is not favorable for me. Moreover, as I do not have the super user ...