Invoke script within a script

I have a shell script, and I am trying to invoke another shell script from within this shell script, but it just doesn't want to work for me.

The name of the script is "extractSENDER.csh"

Here's what I've tried in my script:
1) extractSENDER.csh and `extractSENDER.csh`
2) echo extractSENDER.csh and `echo extractSENDER.csh`
3) echo `extractSENDER.csh
4) set xxx = "echo extractSENDER.csh"
echo xxx

I could sit here forever, I don't even know what I haven't tried.

Can anyone help please?

By the way, the only thing the script that I am trying to invoke does is: it reads a mail file, extracts the sender, and saves the senders email address to a file named SENDER.

The script works fine if I invoke it myself from a command prompt, its just not working when trying to invoke it within my other script.

in the same directory:

./extractSENDER.csh

or preferably:

/full/path/to/extractSENDER.csh

if the script you're trying to execute [extractSENDER.csh] is a CSH script, make sure that you specify the correct path to the CSH interpreter in the first line of this script. Something like this for extractSENDER.csh:

#!/bin/csh
....... the rest of the script.......

When you say 'it just doesn't want to work for me', what do you actually see when you try it? Any error messages?

rebor's answer was on the money.

Its a script that is invoked upon the arrival of an email message, and processes some information. I would basically get an error message back where I sent the test email giving me errors that occured while the script tried to run.

I got one more question..........for today :smiley:

Now I'm trying to invoke another script, but this script has parameters, and doesn't seem to work like the other script invokation, which didn't take any parameters. Maybe I need to double-check my code. But just in case, would i call the script the same way, without any quotes or anything?
Here is how I'm calling it at the moment:

/path/to/script $email_name $email_domain

Does this look right?

Thanks for your help.

That does look correct.

I always prefer to use ${} for variables.

/path/to/script ${email_name} ${email_domain}

I don't know what is happening. Let me give a little scope of my problem:
1) An email is received, and it is forwarded to a shell script.
2) the main script copies entire email contents to a file
3) the main script calls another script to extract the email address of the sender (the previous problem that I mentioned)
4) the main script then calls another script to validate that email address (I have a text file that contains all of the valid emails), and the other script also writes some information such as the users name, etc, to a file name OWNER

This is where I'm having a problem now. If I invoke the main script (the same script invoked when an email is received) from the command prompt, it works fine. But when an email is received, and the main script is invoked, everything works, except #4. It seems like its sending empty strings as the parameters to the script (I tried outputing the values of the variables I'm passing as parameters, and they have the correct values in the main script. Then I also output the variables in script that is invoked, but it outputs empty lines)

I dont even know how to ask my question, I'm just venting now I guess. If you have any suggestions for me, please throw'em at me, if not, thanks for reading.

By the way, here's how I've tried calling the script from within the main script:
/path/to/script ${arg1} ${arg2}
/path/to/script `echo ${arg1} ${arg2}`

Maybe I just need to take a break, and look at it again, maybe I'm just missing something.

Could there be a problem with me accessing a file when the script is invoked? What I mean is, when I run the script throught a unix prompt, it works fine. But when an email is sent, and the scripts are envoked, one of the scripts tries to read from a text file which already exists in my directory.

Well, I'm thinking, when an email is sent and the scripts are envoked, they are running under a different context, so I'm thinking that the scripts are running under a different set of permissions. I saw something about setuid, and setgid. How can I use one of these to give certain scripts the permission to read from files that already exist?

Hope what I said made sense.