I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them)
Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++ programs that are called to perform two different tasks.
The problem is that only part of the script is being executed. The 'foreach' loop is completed without fail and does exactly what it is supposed too - calls the NCAT_2_MCdose C++ function (which is an image deformation type program). This tells me that the parent script is calling the second script correctly. However, when it attempts to execute the next line of
it fails. This function has execution permission and the path is correct. Now for the truly strange part. When I run the second script with these two C++ functions in it from the command line it executes perfectly. However, executing it from the parent (first script) only performs the foreach loop and the second program isn't even called (I can't even get any stout or sterr output to be written using the 1> and 2> redirection options.
Is there any suggestions to resolve this? I've spent 2 straight days on this and have finally conceded that I don't know enough and would really appreciate a fresh outlook on this.
Edit: I should add, this second function takes 5 files (with naming convention ${ANG}_ph1to1_mapped.3ddose) and adds them together, each with a weighting of 0.2 with the result being output in the ${ANG}_total_mapped.3ddose. Again, this command works flawlessly when used separately on the command line, or by running this script independently from the parent program.
Last edited by pollsizer; 06-06-2008 at 11:37 PM..
After I compile a C program, when I run it from a C shell script, it does not print out the results.
e.g:
myCFile.c: main(){printf("Hey");}
myCshScript: myCFile
This does not output "Hey" to the terminal window. I am not even sure if it is executed or not.
What should I do to see the... (2 Replies)
Hi Friends,
Could you pleas help me out..
I have an awk program which works fine while running it in the command prompt.
The awk program is
===============
awk 'BEGIN {
format="head -%d M2_Sales_N01.txt |tail -%d >M2_Sales_N01_%02d.txt\n"
n=0
m=0
}
{
if (n==0)
{
tmp=$1
n=1
}... (5 Replies)
Hi All,
I have the following script.
#!/bin/csh
#
# createDATfile.sh
#
cd /export/home/fastserv/bin
source /export/home/fastserv/bin/dbenv.sh
echo `date` >> /export/home/fastserv/bin/log.txt
echo "%INF% Starting send of current FASTSERVICE batch" >>... (4 Replies)
Hi everyone,
I have never wrote script in csh before, but I need to add only few lines to an existing one. I tried to use the bash standard syntax, and it did not work. So, I attempted to use csh syntax, and it is not working. Can someone help please:
switch ( $Return_Code )
case 0:... (3 Replies)
Hi
This little script is giving me error: Syntax error at line xxx : `(' is not expected. Wgat did I miss?
RC=0
switch ( $RC )
case 0:
echo Done
breaksw
case -1:
echo not done
breaksw
default:
echo "Hello"
endsw (2 Replies)
Ok I asked something similar earlier with no response, so maybe I didn't word it correctly. I'm new at this, so thank you for your help.
Here's what I have right now.
----------------------------
> cat MySourceFile
#!/bin/csh
echo "Please Enter Value For My_Env_Var:"
set answer = $<
... (1 Reply)
Hey I am brand new to this forum and scripting.
I have several documents (1000+) all formated exactly the same. Each document contains 97 lines. I want to pull 3 lines from the documents to populate a file. These 3 lines are line number 9, 24, and 58.
Ok my questions: Instead of using... (3 Replies)
Hey all,
I've only just started using UNIX coding on my Masters project, so am still learning!! The script I've been writing is literally just for me to get used to writing it and seeing what I can do with some data I've been given.
I'm trying to write a script, where the penultimate line... (2 Replies)
Hello all. I suspect this will be a simple case for an experienced csh scripter, but google is getting me nowhere on this one.
I'm trying to get someone else's set of scripts to work for me, and it's choking when the following script gets called:
#! /bin/csh
if (x$1 == x) then
echo ' you... (1 Reply)
I have csh script and call tck command but it do nothing. can you help me?
I only can see it echo
#!/bin/csh -f
set mypath = `pwd`
echo $mypath
if ($mypath =~ *PLL*) then
echo "source ../PreBoot.qel"
else if ($mypath !~ *PLL*) then
echo "source ../hdfuse.qel"
endif
if i remove... (1 Reply)
Discussion started by: sabercats
1 Replies
LEARN ABOUT XFREE86
suspend
suspend(1) User Commands suspend(1)NAME
suspend - shell built-in function to halt the current shell
SYNOPSIS
sh
suspend
csh
suspend
ksh
suspend
DESCRIPTION
sh
Stops the execution of the current shell (but not if it is the login shell).
csh
Stop the shell in its tracks, much as if it had been sent a stop signal with ^Z. This is most often used to stop shells started by su.
ksh
Stops the execution of the current shell (but not if it is the login shell).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), kill(1), ksh(1), sh(1), su(1M), attributes(5)SunOS 5.10 15 Apr 1994 suspend(1)