John H Darrah <[EMAIL PROTECTED]> writes:

> On Thu, 15 Feb 2001, Jonathan Wilson wrote:
> 
> 
> > if  [ "$1" != *.src.rpm ] && [ "$1" != *.srpm ]
> 
> I didn't notice the above line in my previous post.
> Unfortunatly, the file globing is expanding to multiple
> arguments.
> 
> You will have to use a `case' statement or other trickery.
> 
> Maybe like this:
> 
>   if [ ! -z "${1##*.src.rpm}" ] && [ ! -z "${1##*.srpm}" ]
>   then

[...]

I'm probably missing the boat here but it looks like something simpler
would work here:

  if echo $1|egrep -v  '\.(src\.|s)rpm' >/dev/null
  then
          echo "Hey this simple test works"
          echo "Guess what? => $1 <= is not a source rpm"
          exit 1
  fi

  trap 'kill 0' 0 1 2 3

[...]

ps- I think moving the `trap' below the two tests will eliminate the
    `Terminated' comment if either of the tests fail.  Nothing to kill
    yet.  It will still show up if the script goes past the two tests.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to