[GRASS-dev] [bug #4498] (grass) d.out.png script copied to docs/html/ in err

Huidae Cho grass4u at gmail.com
Wed May 24 11:12:46 EDT 2006


What about this?

         -for file in  *.png *.jpg ; do \
                 if [ `head -1 $$file` != '#!/bin/sh' ] ; then
                    $(INSTALL_DATA) $$file $(GISBASE)/docs/html \
                 fi \
          done 2> /dev/null ; true

Checking if a file is excutable could be unreliable in a certain environment.

Huidae Cho

On Wed, May 24, 2006 at 06:00:43PM +0300, Wolf Bergenheim wrote:
> On Wed, 24 May 2006, Markus Neteler wrote:
> >How to get
> >       -for file in  *.png *.jpg ; do \
> >               head -1 $$file | grep '#!/bin/sh' > /dev/null \
> >               if [ $$? -ne 0 ] ; then
> >                  $(INSTALL_DATA) $$file $(GISBASE)/docs/html \
> >               fi \
> >               done 2> /dev/null ; true
> >working (in include/Make/Html.make)?
> >The problem is that $$? isn't found. Maybe there is a less ugly trick to
> >test if
> >the first file of the $$file is a shell script.
> 
> I'm no expert but shouldn't
>     -for file in  *.png *.jpg ; do \
>          if [ ! -x $$file ] ; then \
>             $(INSTALL_DATA) $$file $(GISBASE)/docs/html \
>          fi \
>          done 2> /dev/null ; true
> 
> do the trick since shellscript should be executable?
> 
> --W
> 
> -- 
> 
> <:3 )---- Wolf Bergenheim ----( 8:>
> 
> _______________________________________________
> grass-dev mailing list
> grass-dev at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-dev




More information about the grass-dev mailing list