[GRASS-user] seeking advice for additional scripts

Paulo van Breugel p.vanbreugel at gmail.com
Wed Apr 6 01:24:41 PDT 2016


On Tue, Apr 5, 2016 at 9:06 PM, Martin Landa <landa.martin at gmail.com> wrote:

> Hi,
>
> 2016-04-05 20:59 GMT+02:00 Ken Mankoff <mankoff at gmail.com>:
> > Where should this script go, and do you have advice on what language to
> use? My first thought was to make it a bash shell script and put it in
> ~/bin/ or ~/bin/grass/ and add that to GRASS_ADDON_PATH. Is there standard
> location for things like this?
>
> I would choose ~/bin/grass (~/bin is not good choice because than your
> scripts will be in default PATH, so visible also outside of GRASS).
>

If you are on Linux, I think you can copy your script to the same folder
that is used by g.extension to install addon scripts. For me that is
~/.grass7/addons/scripts , but I assume that is the same on most Linux
systems.


>
> > And should it be in Python or bash? Seems like either works right now,
> but will bash be phased out in the future?
>

>From what I understand, there are no plans to phase out bash, so you could
use that if that works best for you. For sharing with others python is
probably the better choice, especially because of compatibility issues on
Windows.


> For simple/quick stuff I would use Bash. For the rest (more complex
> stuff, anything you want to publish as addons) I would choose Python.
> Please note that GRASS 7 supports only Python for Addons.
>

That depends how you define addons. You cannot install shell scripts with
g.extension, but if you put them in ~/.grass7/addons/scripts they should
work fine. Having said that, Python would still be the better option.



> Ma
>
> --
> Martin Landa
> http://geo.fsv.cvut.cz/gwiki/Landa
> http://gismentors.cz/mentors/landa
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160406/64c3c2e6/attachment.html>


More information about the grass-user mailing list