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
0
votes
0
answers
100
views
bjobs output not being stored properly in variable
So, I have the following script:
#!/bin/bash
while :
do
bjobs_output=$(bjobs)
echo HELLO
echo $bjobs_output
echo WORLD
sleep 1
done
I am running the command in a cshell because ...
4
votes
2
answers
2k
views
"^M: Command not found" from script [duplicate]
I am trying to run the following script.
#!/bin/csh
# USAGE EXAMPLE: solve_mysteries.scr ops6.txt 2
# USAGE EXAMPLE: solve_mysteries.scr allops.txt 1800
set opsfile = $1
set maxtime = $2
set f = $3
...
0
votes
1
answer
1k
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:...
0
votes
1
answer
17k
views
Why is xterm not found in my C shell and how can I add it as I find it in TERM
I get this error:
X terminal for some input / output,
please make sure "xterm" command can be found in
your PATH environment
When I
echo $TERM
I get xterm. But xterm cannot be found on my ...
0
votes
1
answer
2k
views
Without nohup on csh, background job still running after ssh exits
I'm trying to understand the need for using nohup with background commands in ssh. My shell is csh on CentOS.
The background command below continues running even after ssh exits. I was expecting this ...
0
votes
2
answers
268
views
csh to get difference been start and end time both inputs in hh:mm:ss format
./script.csh 05:25:00 02:30:50
should return output in mins
since i am looping through the series recursively how to compare values with new large value . would | bc work in csh ?
3
votes
1
answer
2k
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. It ...
0
votes
1
answer
44
views
file name matching
I have 2 folders with number of files with a pattern of
File-1 1234_-_abcdef_abcdefg.abc
File-2 1234_-_qwerty_abcdefg.abc
My code goes like
foreach d (`cat deck_list`)
foreach c (`cat cars_list`...
0
votes
1
answer
85
views
How to read and replace with two arguments file in Cshell?
I'm trying to make a script what automatically replace a word in the text file.
In a.v,
BIRA_0 0
BIRA_1 400
BIRA_2 800
BIRA_3 C00
...
in b.v,
BIRA_0[25:0]
BIRA_0[95:26]
BIRA_0[125:96]...
1
vote
1
answer
1k
views
Validate the user input against a specific pattern BASH
if ($input !~ [[:upper:-]][[:digit:]][[:digit:]][[:digit:-]][[:digit:]][[:digit:]][[:digit:]]) then
goto error1
else
echo $input
endif
I have tried the above code to match the pattern "P-70-90" ...
0
votes
0
answers
368
views
Find and print permissions command in a csh file
Trying to create a .csh file that can find and display permission of the files in the directory.
Using the following content of the script
#!/bin/csh -b
find . type -f \( -name "*.sh" -o -name "*....
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 ($...
2
votes
3
answers
4k
views
How can I dynamically change a path in my aliases?
I have a bunch of aliases in my .cshrc file which use the path:
/projects/project_name/my_name/$CLIENT
I've written a short script which is intended to take a folder name from my working directory ...
0
votes
1
answer
213
views
Which of the following commands created a bash subshell
Which of the following commands created a bash subshell?
bash
bsh
csh
None of the above
This question asked in recent exam and i was unable to answer. Can any one give me right ...
2
votes
1
answer
695
views
How to use if on csh FreeBSD from test if file is older then X minutes
I have the following code working in Debian system's:
for File in "${Files[@]}"; do
if test "`find $FolderDownload/$File -cmin -190`" ; then
echo "File is new then 3 hours"
# Set ...