Questions tagged [csh]
The C shell (csh), once one of the two major Unix shells with the Bourne shell. Csh had more advanced interactive feature but has been surpassed by modern Bourne-style shells such as zsh and bash.
287
questions
1
vote
1
answer
2k
views
Setting environment variable using shell script
I am using csh scripts for some automation purpose. I have a number of scripts, and the beginning of all of which I need to set a fixed set of environment variables.
|----SCRIPT 1---| |----SCRIPT ...
0
votes
1
answer
30
views
cleartool command not found from .cshrc but found when manually called
I'm having an issue with cleartool commands called from my .tcshrc. I try to call cleartool setview, but get a cleartool: Command not found error. however, when I call the command from the terminal, ...
2
votes
3
answers
4k
views
CSH and all output (with errors) to file
I need save all output from compilation to file. I have many errors undefined reference and I want see all of these errors.
I try makeall >& out, but in file out aren't any of error undefined ...
0
votes
2
answers
58
views
Find files created after a particular time in csh on SunOS
On my SunOS system, I'm trying to find all files created after 7 PM using csh, ls, and awk.
ls -l "${Source_files_Dir}"/*.zip| awk -v today="$(date "+%b %d")" '{
date=$6&...
0
votes
1
answer
2k
views
How to execute an alias, encapsulated in another source file?
For instance
~/.cshrc:
alias job_start 'cd $PROJ_DIR && source .env/bin/activate.csh && rehash && job_run'
$PROJ_DIR/.env/bin/activate.csh:
alias job_run '(cd $PROJ_DIR/...
0
votes
0
answers
17
views
Changing variables inside a csh script [duplicate]
I have a csh script and I have to callenter code here bash script that changes the value of an environment variable, like this:
changevar file:
#!/usr/bin/bash
export FFF=0
beforevar.csh file
#!/bin/...
2
votes
1
answer
2k
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
2
answers
115
views
Load files in sequential order
I need to load multiple files in my shell script with the same filename but appended in the front of each file name is YYMMDDPERSONNEL
Examples: 231102PERSONNEL and 230103PERSONNEL
There are many ...
0
votes
0
answers
33
views
Substitute square bus in csh script
I have input list: adr[0] adr[1] xadr[0]
I want my output is: adr[*] adr[*] xadr[*]
#! /bin/csh -fv
set list = "adr[0] adr[1] xadr[2]"
foreach f (${list})
set f_tmp = `echo "$f&...
0
votes
1
answer
45
views
How can wildcard expansion create duplicates?
I have a directory with an absurd number of files, which makes this nigh impossible to understand by inspection. But here's the situation:
cp giant_folder/pre* myfolder
It's crunching along and ...
1
vote
1
answer
2k
views
csh: redirecting output from foreach
In csh: How do I redirect the output from a foreach-loop to a pipe?
This works but uses a temp file:
set tmpfile=/tmp/file ...
0
votes
1
answer
989
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
1
answer
115
views
C-Shell - stripping wildcards from user input
I am trying to strip wildcards from user input text in a c-shell script.
I realize that the shell automatically expands all wildcards prior to storing the data.
Is there a way to isolate the non-...
0
votes
1
answer
101
views
Calling a script from within csh with output redirection
What I would want:
#!/bin/csh
# call /myscriptpath/myscript.any and redirect 2>&1 and get retval and output
set my_msg = `/myscriptpath/myscript.any`
set my_ret = `echo $?`
How to capture the ...
0
votes
1
answer
110
views
When logging into a UNIX/Linux box, which profile scripts are executed?
When logging into a UNIX/Linux box, which profile scripts are executed?
Typically there are several different profile scripts that set the $PATH variable and other aspects of the user's environment. ...