Re: SHELL Dependency between scripts??
From: Adam Price (adam+usenet_at_pappnase.co.uk)
Date: 10/30/04
- Previous message: qazmlp: "SHELL Dependency between scripts??"
- In reply to: qazmlp: "SHELL Dependency between scripts??"
- Next in thread: Bill Marcum: "Re: SHELL Dependency between scripts??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 30 Oct 2004 17:06:16 +0100
On 30 Oct 2004 07:40:50 -0700, qazmlp wrote:
> I have the following scripts.
> -------first.sh-------
> #!/bin/csh
>
> setenv FIRST first
> source second.sh
> -------first.sh-------
>
> ------second.sh-------
> #!/bin/ksh
>
> echo FIRST=$FIRST
> export SECOND=second
> -------second.sh------
>
> When I execute first.sh, the following error is reported:
>
> FIRST=first
> export: Command not found
>
>
> Why exactly 'export: Command not found' error is reported?
> When second.sh is executed separately, it works fine. So, why should
> the error be reported when it is invoked from a different script?
>
> Does this error indicate that, the shell used by all the shell scripts
> has to be same, if the case is one script is used by another
> script(s)?
>
> Kindly clarify!
source is a c-shell directive which means execute the named file in the
current shell.
So when you try to run second.sh from first.sh you are running it with the
csh interpreter.
If you don't use source then it should work fine.
Adam
- Previous message: qazmlp: "SHELL Dependency between scripts??"
- In reply to: qazmlp: "SHELL Dependency between scripts??"
- Next in thread: Bill Marcum: "Re: SHELL Dependency between scripts??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|