> I am using simple diff command. My script is
>
> #/bin/sh
>> I am using simple diff command. My script is
>>
[quoted text clipped - 3 lines]
>
> #!/bin/sh
Not necessarily a problem. The original is actually a comment (whether it's
meant to be or not) so the script will be run with the default shell rather
than being forced to use /bin/sh.
As to the return value, the script/shell will return the exit status of the last
command, in this case diff. If the files differ then diff, and hence the
script, will not return 0.

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Bhanu - 16 May 2007 15:27 GMT
> >> I am using simple diff command. My script is
>
[quoted text clipped - 17 lines]
> E-mail : n...@ion.le.ac.uk
> Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Sorry for error in posting the message that line reads #!/bin/sh in
the script
somehow i did mistake while posting the message
But I figured out the error
I tried the following on command prompt
diff build.xml conf/invoker_config.xml > test.log
echo $?
and the result was amazingly 1.
Bhanu - 16 May 2007 15:30 GMT
> >> I am using simple diff command. My script is
>
[quoted text clipped - 17 lines]
> E-mail : n...@ion.le.ac.uk
> Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
The problem is something else
I just tried the following on command prompt.
diff -c build.xml conf/invoker_config.xml > test.log
echo $?
and the result was amazingly 1.
Bhanu - 16 May 2007 15:53 GMT
> >> I am using simple diff command. My script is
>
[quoted text clipped - 17 lines]
> E-mail : n...@ion.le.ac.uk
> Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Now I found the root problem
diff command exits with 0 status only when 2 files are equal
for unequal files it returns 1.
:) ..
Lew - 16 May 2007 22:22 GMT
>>>> I am using simple diff command. My script is
>>>> #/bin/sh
[quoted text clipped - 17 lines]
> diff command exits with 0 status only when 2 files are equal
> for unequal files it returns 1.
You found this by reading Nigel's post, which you keep quoting, yes? The one
where he explained exactly that?

Signature
Lew