[GRASS-dev] Re: [bug #4498] (grass) d.out.png script copied

Hamish hamish_nospam at yahoo.com
Thu May 25 01:28:32 EDT 2006


> > >this bug's URL: http://intevation.de/rt/webrt?serial_num=4498
> > >------------------------------------------------------------------
..
> > >Subject: d.out.png script copied to docs/html/ in err
..
> >         -for file in  *.png *.jpg ; do \
> >                 head -1 $$file | grep '#!/bin/sh' > /dev/null \
..
> Also, I would just check for #! at the beginning of the line;
> #!/bin/sh is too specific (e.g. you could have a space after the #!,
> or it might be a script in some other language).

two points:

1) is it better to use `file $file | grep script` ? 
Is "file" as portable as "head -1|cut -c1-2" will i18n break the grep?

2) are we going about it from the wrong end: the above doesn't copy the
file if it _is a script_. Shouldn't the test not copy the file if it
_isn't an image_?


Hamish




More information about the grass-dev mailing list