[GRASS-dev] [GRASS GIS] #2975: support bash on windows 10

GRASS GIS trac at osgeo.org
Sat Sep 1 02:50:24 PDT 2018


#2975: support bash on windows 10
--------------------------+----------------------------------------
  Reporter:  martinl      |      Owner:  grass-dev@…
      Type:  enhancement  |     Status:  new
  Priority:  normal       |  Milestone:  8.0.0
 Component:  Startup      |    Version:  unspecified
Resolution:               |   Keywords:  bash, wingrass, windows 10
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+----------------------------------------

Comment (by hellik):

 Replying to [comment:7 wenzeslaus]:
 > There is a difference in syntax, so the binaries are there, but not the
 command line tricks, right?

 an example with grep.

 list shapefile in a directory by dir /b

 {{{
 D:\wd\sample_data>dir /b
 sample_shapefile01.cpg
 sample_shapefile01.dbf
 sample_shapefile01.prj
 sample_shapefile01.qpj
 sample_shapefile01.shp
 sample_shapefile01.shx
 sample_shapefile02.cpg
 sample_shapefile02.dbf
 sample_shapefile02.prj
 sample_shapefile02.qpj
 sample_shapefile02.shp
 sample_shapefile02.shx
 sample_shapefile03.cpg
 sample_shapefile03.dbf
 sample_shapefile03.prj
 sample_shapefile03.qpj
 sample_shapefile03.shp
 sample_shapefile03.shx
 sample_shapefile04.cpg
 sample_shapefile04.dbf
 sample_shapefile04.prj
 sample_shapefile04.qpj
 sample_shapefile04.shp
 sample_shapefile04.shx
 sample_shapefile05.cpg
 sample_shapefile05.dbf
 sample_shapefile05.prj
 sample_shapefile05.qpj
 sample_shapefile05.shp
 sample_shapefile05.shx
 }}}

 ls is also shipped by OSgeo4W winGRASS:

 {{{
 D:\wd\sample_data>ls --version
 ls (GNU coreutils) 5.97
 Copyright (C) 2006 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms
 of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.

 Written by Richard Stallman and David MacKenzie.
 }}}

 {{{
 D:\wd\sample_data>ls
 sample_shapefile01.cpg  sample_shapefile02.cpg  sample_shapefile03.cpg
 sample_shapefile04.cpg  sample_shapefile05.cpg
 sample_shapefile01.dbf  sample_shapefile02.dbf  sample_shapefile03.dbf
 sample_shapefile04.dbf  sample_shapefile05.dbf
 sample_shapefile01.prj  sample_shapefile02.prj  sample_shapefile03.prj
 sample_shapefile04.prj  sample_shapefile05.prj
 sample_shapefile01.qpj  sample_shapefile02.qpj  sample_shapefile03.qpj
 sample_shapefile04.qpj  sample_shapefile05.qpj
 sample_shapefile01.shp  sample_shapefile02.shp  sample_shapefile03.shp
 sample_shapefile04.shp  sample_shapefile05.shp
 sample_shapefile01.shx  sample_shapefile02.shx  sample_shapefile03.shx
 sample_shapefile04.shx  sample_shapefile05.shx
 }}}

 now if you want the output of dir/ls filtered by grep using the pipe:

 {{{
 D:\wd\sample_data>dir /b | grep .shp
 sample_shapefile01.shp
 sample_shapefile02.shp
 sample_shapefile03.shp
 sample_shapefile04.shp
 sample_shapefile05.shp
 }}}

 {{{
 D:\wd\sample_data>ls | grep .shp
 sample_shapefile01.shp
 sample_shapefile02.shp
 sample_shapefile03.shp
 sample_shapefile04.shp
 sample_shapefile05.shp
 }}}

 there may be some differences in the syntax caused by different operating
 system characteristics; the main work flow is similar.

 is the linux way to do things the only right way to do things? ;-D

 one may argue that the native windows powershell is the same powerfull as
 the linux shell.

 {{{
 D:\wd\sample_data>powershell
 Windows PowerShell
 Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

 PS D:\wd\sample_data> ls


     Verzeichnis: D:\wd\sample_data


 Mode                LastWriteTime         Length Name
 ----                -------------         ------ ----
 -a----       01.09.2018     11:25              5 sample_shapefile01.cpg
 -a----       01.09.2018     11:25             66 sample_shapefile01.dbf
 -a----       01.09.2018     11:25            143 sample_shapefile01.prj
 -a----       01.09.2018     11:25            257 sample_shapefile01.qpj
 -a----       01.09.2018     11:25            100 sample_shapefile01.shp
 -a----       01.09.2018     11:25            100 sample_shapefile01.shx
 -a----       01.09.2018     11:25              5 sample_shapefile02.cpg
 -a----       01.09.2018     11:25             66 sample_shapefile02.dbf
 -a----       01.09.2018     11:25            143 sample_shapefile02.prj
 -a----       01.09.2018     11:25            257 sample_shapefile02.qpj
 -a----       01.09.2018     11:25            100 sample_shapefile02.shp
 -a----       01.09.2018     11:25            100 sample_shapefile02.shx
 -a----       01.09.2018     11:26              5 sample_shapefile03.cpg
 -a----       01.09.2018     11:26             66 sample_shapefile03.dbf
 -a----       01.09.2018     11:26            143 sample_shapefile03.prj
 -a----       01.09.2018     11:26            257 sample_shapefile03.qpj
 -a----       01.09.2018     11:26            100 sample_shapefile03.shp
 -a----       01.09.2018     11:26            100 sample_shapefile03.shx
 -a----       01.09.2018     11:26              5 sample_shapefile04.cpg
 -a----       01.09.2018     11:26             66 sample_shapefile04.dbf
 -a----       01.09.2018     11:26            143 sample_shapefile04.prj
 -a----       01.09.2018     11:26            257 sample_shapefile04.qpj
 -a----       01.09.2018     11:26            100 sample_shapefile04.shp
 -a----       01.09.2018     11:26            100 sample_shapefile04.shx
 -a----       01.09.2018     11:26              5 sample_shapefile05.cpg
 -a----       01.09.2018     11:26             66 sample_shapefile05.dbf
 -a----       01.09.2018     11:26            143 sample_shapefile05.prj
 -a----       01.09.2018     11:26            257 sample_shapefile05.qpj
 -a----       01.09.2018     11:26            100 sample_shapefile05.shp
 -a----       01.09.2018     11:26            100 sample_shapefile05.shx
 }}}


 >I have seen people using or recommending Git Bash (see e.g. ​this
 Software Crapentry >Workshop at NCSU). Git Bash uses MSYS AFAIU.

 what is the real advantage to use Git Bash/MSYS instead of using the GNU
 tools on the windows native console?

 how to tackle the maintenance work load to integrate Git Bash/MSYS? e.g.
 to keep them update or fix securities issues?

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/2975#comment:11>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list