David,
Take the single quotes off the brtype when assigning the cleartool
command to BRANCH_QUERY. The reason the echo'd command works is that the
shell is taking off the single quotes around the brtype. Whereas when
the command is executed using `$BRANCH_QUERY` they are not.
Les.
David Bainbridge wrote:
>
> Hi,
>
> How can I invoke cleartool find in a bourne shell script? (I am using CC
> 3.2.1 on Solaris)
>
> Here's an example:
>
> #!/bin/sh
>
> VOB=${2}
>
> BR=${1}
>
> BRANCH_QUERY="cleartool find ${VOB} -branch 'brtype(${BR})' -print"
>
> echo "$BRANCH_QUERY"
>
> if [ -n `${BRANCH_QUERY}` :="" ]; then
> echo "branch exists"
> exit 0
> else
> echo "branch does not exist"
> exit 1
> fi
>
> When I run this I get:
> cleartool: Error: Unrecognized operator: "'brtype'
>
> If I execute the echo'ed command it works!
>
> I have tried various approaches to solving this (including RTFM) but no
> success ...
>
> Any ideas anyone?
>
> Dave
>
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This archive was generated by hypermail 2b29 : Sun May 06 2001 - 00:22:31 EDT