Questions tagged [tcsh]

tcsh (TENEX C shell) is a shell for Unix-like operating systems and an enhanced, but completely compatible version of the Berkeley UNIX C shell (csh).

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

PATH behaves differently in bash and csh when directory is execute only?

We have some applications in various subdirectories that we limit access to by unix group, and we want them to be execute only. So, for example, if we want members of the "chem" group to ...
0
votes
2answers
50 views

Execute a command in a separate konsole then let users type commands

I am working on software at a large corporation where I have little control over the overall technologies used, and as a result need to find solutions that will work within the constraints I have. ...
0
votes
0answers
11 views

tcsh complete command for TAB completing inner folders from a given one

I'm trying to make TAB to work like that: kill_date folder_name sub_folder_name folder_name - is a folder in a specific path. sub_folder_name - is the inner folder inside folder_name (which is the ...
0
votes
0answers
10 views

Prevent tcsh history printing multiple times

History of commands is getting printed multiple times when exiting the session and logging again. when using below in .cshrc alias postcmd "history -M; history -S" My .cshrc looks like ...
0
votes
0answers
23 views

Delete duplicate entries from history file with tcsh

I am trying to remove duplicate entry(of command with same timestamp) from history file. my .cshrc file looks like below, set TERMINAL=`who am i | nawk '{print $NF}' | tr -d '()'` set history= (1000) ...
0
votes
0answers
55 views

Ambiguous output redirect error in find command [duplicate]

Apologies if this is a repeated question, I am trying to search for a file in all the subdirectories in a given path. While doing so I also want to suppress any output messages, errors from the find ...
0
votes
0answers
18 views

history manipulation in tcsh, substitute every match

I know everybody will tell me that I should switch from using tcsh to bash or something else, but hysteresis is a powerful force, so I'm not going to. Most of the time I find tcsh perfectly ...
0
votes
0answers
13 views

How to get completion by the end of the word in tcsh?

I am using tcsh, and i would like that the shell will complete my word according to the end of the file name. For Ex: In the current directory i got this files: file1 file2 file3 So when Writing ...
0
votes
1answer
105 views

Is there a way to disable history for one command in TCSH?

I am executing a command in TCSH, which requires me to pass a password on the command line. Obviously, I would like it not to be saved in the history file. I know that other shells like Bash supports ...
0
votes
1answer
64 views

why tcsh script choke on special characters inside file eg. #{ on a line is giving missing “}” error

I'm using tcsh shell script to read each line of a file input.txt script #!/bin/tcsh set out_file_length=`wc -l<$1` set i=1 while ( $i <= $out_file_length ) set each_line = `head -$i input....
0
votes
0answers
9 views

csh: How are outputs managed when executable called from within script?

Suppose I have a script something like this: set command = "func arg1 arg2" eval $command Or perhaps (not sure which is best): ($command) If func generates output to stderr and stdout, how ...
0
votes
1answer
72 views

How to iterate over all of the files and directories in a directory?

I'm trying to iterate over all of the files/directories in a directory. That includes also all of the hidden files (without . and ..). From previous topic in Bash it was suggested to use: for current ...
0
votes
1answer
23 views

How to declare an array of items in tcsh that separates on multilines?

I'm trying to declare an array of items in tcsh that separates on multilines. I tried: set ignore_array = ( 'a' 'b' 'c' ) Also tried: set ignore_array = { 'a', 'b', 'c' } how ...
0
votes
1answer
26 views

Can't create an alias in tcsh shell when trying to sed some string with .*

I'm trying to create this alias in tcsh shell: alias repeat 'zgrep -i __NCELAB_SNAPSHO \!* | grep -v make | grep -v Flags | sed 's#CODE_COVERAGE_TYPES.*TEST_DONE=1##g'' And getting an error: alias:...
1
vote
1answer
99 views

How to understand which shell a particular code belongs to without knowledge about the shell?

I get to understand that this code is for bash shell for f in $file.docked.[0-9][0-9][0-9] do mv $f $f.pdb done And this code is for tcsh shell foreach f ( file.docked.[0-9][0-9][0-9] ) mv $f ...
0
votes
0answers
42 views

How to change directory from environment variable in tcsh?

I have captured a linux path into an environment variable. Now I want to change the directory to the path in that environment variable. Lets say the environment variable is named: gr I can see the ...
0
votes
0answers
40 views

How do I use spaces in my command to cd to a directory and its sub directories using aliases?

Suppose I am interested in this directory: /home/username/../../../../.....dummy1 And dummy1 has these subfolders: sub_dummy1 sub_dummy2 that in turn can consist of various directories and so on. ...
0
votes
0answers
127 views

macOSx / what is the kernel variable os_refcnt counting and what might be causing it to overflow?

Trying to figure out why running some software that I am developing causes my Mac to do a panic restart every 16 h or so always with an "os_refcnt" kernel variable overflow when running tcsh scripts. ...
0
votes
0answers
44 views

i need to convert from tcsh to bash

I have a script written in tcsh that I am trying to convert to bash. It takes files from the current directory and runs the command mripreproc on them. I need to execute in bash, can you please point ...
0
votes
2answers
47 views

How to add a specific line in a file to the end of the specific line in another file? (use sed maybe)

I have a file, supermaster.PRM: num_valid_az = 12194 nrows = 12194 first_line = 1 deskew = n caltone = 0.000000 st_rng_bin = 1 Flip_iq = ...
1
vote
1answer
22 views

Getting tcsh dextract-like pushd functionality in bash

I love bash (4.1.2(1)-release) but I strongly prefer the way tcsh implements pushd +N with the dextract option enabled, so much so that I refuse to use bash as my default shell because of it. Has ...
1
vote
0answers
99 views

csh/tcsh Tab Completion with “complete = enhance” Strange Behavior

set complete = enhance is put in .cshrc, and we have two files, test_ab_dd.c and test_abc_dd.c. If I type test_ab_<TAB> in the command line, csh DOES NOT autocomplete to test_ab_dd.c. I have to ...
0
votes
2answers
40 views

Should this be two separate lines?: `. echo “test” set dat = $dcmdir/$s/scan.log`

I'm looking at a tcsh script in which one of the lines is: . echo "found scan.log, finding mprages" set dat = $dcmdir/$s/scan.log That's all on one line. Is it feasible that this is actually valid, ...
0
votes
0answers
29 views

Where is the history of a particular tab stored in the TCSH shell and how can i exchange it?

when I close a shell tab, in tcsh, the history save automatically to ~/.history. all the history of all tabs save to the same file. but if I run history command I get the local history of my specific ...
0
votes
0answers
13 views

Why is tcsh's history storage behaviour inconsistent between Linux variants?

When I write a loop in an interactivetcsh, e.g. foreach f ( `find dir/ -type f` ) foreach? mv "$f" "$f".bak foreach? end then want to re-create or write a similar command later on: foreach f ( `...
0
votes
0answers
200 views

pipe into if then in csh/tcsh

I would like to have a csh script to test a variable between two pipes. For example (the incoming resembles a json file but without the newlines and indentations): set debug = 1 cat test.inp | if ($...
0
votes
0answers
48 views

csh: run a command before all terminal commands, but not for commands in sourced files

I'm currently using the csh postcmd alias to run a command before each terminal command is executed. However, I've found that this command also gets executed for every line in a sourced file. For ...
1
vote
2answers
72 views

Drop stderr from ls

When I run ls on a filename that doesn't exist the output reports that. I'd like to drop that output but still report when a file is found. Is this stderr that reports the output below? $> ls foo ...
0
votes
1answer
48 views

How to set PATH to symlinked directory in bash csh

I have the directory /data/bin and in my home directory is symlink /home/myuser/bin -> /data/bin I have set PATH into the /home/myuser/bin/ When /home/myuser/bin is the directory, the PATH works fine,...
0
votes
1answer
102 views

override value of $_ in linux csh script

I would like to override value of $_ in linux csh script. I run this script in xterm using cmdline: chmod +x test.csh test.csh test.csh content: #!/usr/bin/tcsh .... source sourceme.rc .... ...
0
votes
2answers
73 views

cd on the last folder tcsh

trying to cd on the last directory in bash if im trying this : cd $(ls -l | tail -l) it will result in : Illegal variable name. I'm not sure how I should do this
2
votes
1answer
133 views

How can I alias 'emacs file.txt' to 'emacs file.txt &'?

In case this is an XY problem, what I'd like to do is always open Emacs visually as a background process, but still get tab completion and not have to append '&' manually. I'm in Tcsh, no way to ...
0
votes
2answers
2k views

exec /bin/tcsh produces a “if: Expression Syntax.” error

We have two servers: test box with Oracle Linux 7.6 and production box with Oracle Linux 7.7. Running the exec /bin/tcsh command produces two different results. On the test server: # exec /bin/tcsh ...
0
votes
1answer
345 views

tcsh: search entire array for a variable

I am modifying a suite of scripts written in tcsh. Unfortunately, these scripts can't be rewritten because the program they interface with is also written in tcsh. I just want to get out of the way ...
0
votes
1answer
156 views

How to enable “extended_glob” in tcsh?

I am looking to enable 'extended_glob' in tcsh shell and I tried these commands: setopt extended_glob shopt extended_glob But , None of these worked. Can anyone let me know a way to enable this in ...
1
vote
1answer
88 views

Override hostname for mail(1) in a shell script

I'm trying to quickly send some stuff to myself from my MacBook, but I'm having issues with my server rejecting the SMTP connection due to the unqualified domain name in the from field. I've tried ...
2
votes
1answer
303 views

How to make tcsh multiline prompt use newline character?

Scenario I like to use a multi-line prompt. set prompt="${bold}${green}%M${white}:${red}%c5${unbold} \n${white}% " I quite often copy/paste terminal lines into Windows emails. Problem It appears ...
0
votes
1answer
483 views

Ambiguous redirect when running command via ssh

I'm trying to start a program in the background on a remote server via ssh, but this program must be run from the directory it is contained within. I tried doing the following ssh -q user@server 'cd ...
0
votes
2answers
458 views

How to split and access fields delimited by colon?

This piece of code: foreach line (`cat /etc/group`) echo $line end returns line containing 4 fields delimited by :. How to split fields and access the first field of each line?
1
vote
0answers
116 views

cd /bad-directory ; source junk.1 logs me off!

I thought I knew unix/bash etc. The compound statement USING TCSH! cd /lkjsdf ; source junk.1 completes and then logs me off IF the cd directory does not exist. It works fine if the directory ...
1
vote
2answers
266 views

Why is SHELL pointed to /bin/sh in a Csh script?

Yes, I know C-shell is bad. No, I did not choose C-shell. Yes, I would prefer to use a proper shell. No, I cannot switch to a better shell. I have a very simplistic script: /tmp/env_test.csh #!/...
1
vote
2answers
75 views

Why can't tcsh do a single-line 'which -> vim' command?

I often have to do which command, and then open it in vim to actually see what's inside. I'd like to have an alias or function that does this, with tab completion. Here's what I've tried: superwhich()...
1
vote
0answers
73 views

Why does xterm's command line behave like this after changing the prompt?

In my .cshrc file I have the following line: set prompt="%B%n@%m [%d %T] (%h) %c3%#" When I open an xterm, I see user@host [Fri 13:37] (2) ~>0;238;0c Why is 0;238;0c there? I can't spot the ...
0
votes
2answers
96 views

Comparing 2 files using awk , not getting any results - C shell

I am using c shell and trying to compare 2 files using awk . But the below awk statement doesnt give any result. Need to acheive this solution in awk using C shell. awk 'FNR==NR{a[$0]++;next} { {...
7
votes
2answers
1k views

How to produce a PS1 prompt in bash or ksh93 similar to tcsh

In tcsh, I have the default: prompt [%m:%c3] %n%# which gives prompts like: [woehler:hacking/c/hello] ajcarr% and [woehler:~] ajcarr% In other words, the current directory and up to the next ...
0
votes
1answer
317 views

error while using sed in tcsh alias

I am unable to "source/run" my tcsh alias, which is as below: alias inp1 "grep -i "final_model" /scr/cb2TempProd/tmp/$USER/\!:1/Simulation/Input/assemble.preprocessing | sed 's#.*<##; s/>$//'" ...
0
votes
2answers
476 views

How to retrieve prompt format string in csh / tcsh

My current prompt format string is generated by an outside script that is provided by the organization. I want to manipulate it a bit (add time to the string) for that I need my current format string. ...
0
votes
0answers
803 views

tcsh: setenv and updating environment variable from script

I have a script which is supposed to check whether an environment variable exists and if yes update it using an argument read from command line. due to some limitations I should use tcsh and current ...
0
votes
2answers
150 views

What does the -l argument mean in tcsh?

I'm running a tcsh shell. I have questions about the -l option in set -l. When I look at man for the set command, I don't see the -l argument. When using tcsh shell, what does the -l argument mean? ...
1
vote
0answers
205 views

Setting default Linux Shell in RHEL7 using Active Directory

I have a client who has an install script that needs to run under /bin/tcsh as the shell on their Active Directory Domain Joined RHEL7 Virtual Machine. This install script will be run using a service ...

1
2 3 4 5 6