problem running cmd from ksh script
am 25.09.2007 15:38:52 von dave
Hi,
I am running command like this directly from ksh shell:
ant doBuild "-Dstate=INT TEST"
This works from the ksh command line. However, if I run it in a
script with these contents:
#!/bin/ksh
ant doBuild "-Dstate=INT TEST"
It does not work, what is the difference between calling it from shell
cmd line, and the script. The problem is that ant does not pickup my
properties unless i run it directly from command line, has nothing to
do with environment variables from what i can see.
Re: problem running cmd from ksh script
am 26.09.2007 05:51:47 von Barry Margolin
In article <1190727532.281571.209370@k79g2000hse.googlegroups.com>,
dave wrote:
> Hi,
>
> I am running command like this directly from ksh shell:
>
> ant doBuild "-Dstate=INT TEST"
>
> This works from the ksh command line. However, if I run it in a
> script with these contents:
>
> #!/bin/ksh
> ant doBuild "-Dstate=INT TEST"
>
> It does not work, what is the difference between calling it from shell
> cmd line, and the script. The problem is that ant does not pickup my
> properties unless i run it directly from command line, has nothing to
> do with environment variables from what i can see.
They should be identical, assuming ksh is your interactive shell. And
even if it isn't, I think all well-known shells will execute that simple
command line the same way.
My first thought was that maybe the script has a CR before the newline
at the end of the command line, because you wrote it on a Windows box
and didn't transfer it to Unix properly. But that would also break the
#! line, which would result in an error when you try to run the script.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Re: problem running cmd from ksh script
am 27.09.2007 04:20:02 von Rob Silva
> #!/bin/ksh
> ant doBuild "-Dstate=INT TEST"
>
Is ant a function? If so, I think you'd have to source that file to
ensure the function is available to this new script.
You can find out by typing:
type ant
If it's a function, then try sourcing the appropriate file.
Rob