[GRASS-dev] GRASS Initialization - typo

hi,

by screening the GRASS-Installer.nsi-script i've found some typo, see

(http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/mswindows/GRASS-Installer.nsi#L641),
but it's in all branches and in trunk

619 FileWrite $0 '# MODULE: GRASS Initialization$\r$\n'
620 FileWrite $0 '# AUTHOR(S): Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th$\r$\n'
[...]
640 FileWrite $0 'trap "echo '
641 FileWrite $0 "'User break!' ; " <= wrong order of the quotes
642 FileWrite $0 'exit" 2 3 9 15$\r$\n'

where can i find the original file (GRASS Initialization) in the track-svn-source-browser, on which the NSIS-script-write-out is related, to be sure to do the
correct changes for this typo?

best regards
Helmut
______________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

On Wed, Feb 3, 2010 at 8:47 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

hi,

by screening the GRASS-Installer.nsi-script i've found some typo, see

(http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/mswindows/GRASS-Installer.nsi#L641),
but it's in all branches and in trunk

619 FileWrite $0 '# MODULE: GRASS Initialization$\r$\n'
620 FileWrite $0 '# AUTHOR(S): Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th$\r$\n'
[...]
640 FileWrite $0 'trap "echo '
641 FileWrite $0 "'User break!' ; " <= wrong order of the quotes
642 FileWrite $0 'exit" 2 3 9 15$\r$\n'

where can i find the original file (GRASS Initialization) in the track-svn-source-browser, on which the NSIS-script-write-out is related, to be sure to do the
correct changes for this typo?

It is in lib/init/
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/lib/init/
Files:
- grass.bat
- grass.src
- init.bat
- init.sh

Markus

Helmut wrote:

by screening the GRASS-Installer.nsi-script i've found some
typo,

...

FileWrite $0 "'User break!' ; " <= wrong order of the quotes

I'm pretty sure that's intended.
The ! needs to be inside 'single' quotes to avoid being parsed.

$ echo "hello!"
bash: !": event not found

$ echo 'hello!'
hello!

(this may only happen from an interactive terminal, but shell script
composition often happens by the interactive cut & paste trial & error
method)

where can i find the original file (GRASS Initialization)

lib/init/, but I'm doubtful that a change is needed.

Hamish

Hamish wrote:

> by screening the GRASS-Installer.nsi-script i've found some
> typo,
...
> FileWrite $0 "'User break!' ; " <= wrong order of the quotes

I'm pretty sure that's intended.
The ! needs to be inside 'single' quotes to avoid being parsed.

$ echo "hello!"
bash: !": event not found

$ echo 'hello!'
hello!

(this may only happen from an interactive terminal,

It does only happen for an interactive shell; in a script, no quotes
are necessary:

  $ sh -c 'echo "User break!"'
  User break!
  $ sh -c 'echo User break!'
  User break!

But it wouldn't be the end of the world if the exclamation mark was
simply omitted.

As for issues with the .nsi syntax ... based upon a 30-second glance
at the documentation:

Strings can use single quotes, double quotes or backquotes, so you can
use backquotes to quote a string containing both single and double
quotes:

  FileWrite $0 `trap "echo 'User break!' ; exit" 2 3 9 15$\r$\n`

Or you can use "$\":

  FileWrite $0 "trap $\"echo 'User break!' ; exit$\" 2 3 9 15$\r$\n"

--
Glynn Clements <glynn@gclements.plus.com>