All Questions
Tagged with csh shell-script
55
questions
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
0
answers
69
views
need to compare 3 variables and need to print highest of those three variables
set func_ssgnp_0p675v_m40c_typical_Ccworst_R2R_WNS = `grep -i Reg2Reg $tile/../sta/func/sta-max-func-ssgnp_0p675v_m40c_typical_Ccworst/reports/pba_proc_qor.rpt | awk '{print $2}'`
set ...
0
votes
1
answer
640
views
How to pass a variable to a sed command in a csh script?
Unix & Sed noob here!
I have a requirement where I need to put a suffix ",waive" in case a line in a report containing a matching string.The matching string is part of another file "...
0
votes
0
answers
64
views
Replacement in file using bash
I'm trying to translate (a pretty lengthy) script from csh to bash. It takes a 'Makefile' and performs the commands:
cpp_begin_line=`grep -n cpp_flags Makefile | sed 's/:/ /' `
cpp_end_line=`grep -n ...
0
votes
1
answer
763
views
running cshrc script in RHEL 7 from bash account does not work
I was given a software suite which is based around cshrc.
Such that a user is supposed to source a setup.cshrc file and within that it sources numerous other .cshrc scripts to set up the environment ...
1
vote
2
answers
1k
views
what is the csh equivalent of set -xv?
I have a rather long csh script that doesnt work, or doesnt work properly. in bash I would do set -xv to get verbose logging. what can I do in cshell? I tried adding set -xv it complained that - isnt ...
-2
votes
1
answer
118
views
Communicate the data or path from .sh file to .csh
I am able to execute the .csh file from .sh file.
I want to pass the path from a.sh file to b.csh file when it starts to execute the .csh file.
eg:-
#a.sh
if(result=0) then
x=path/to/.csh
#I want to ...
0
votes
2
answers
2k
views
call a .csh file from .sh file
Can I call a .csh script file from .sh shell script file?
For example, I have a.sh, b.csh. Can I call b.csh in a.sh file? If so, how?
I have tried writing this is ash file
variable= source /path/to/b....
0
votes
1
answer
310
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
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
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 ($...
1
vote
3
answers
280
views
How can I give new file names while a program is working in a loop in cshell?
I have lots of .dat file and I want to convert them to .sac file (a type of seismogram file). I convert files with xy2sac program (I didn't write the code), but I have to give converted files a new ...
0
votes
1
answer
444
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
2
answers
106
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}
{
{...