[GRASS-dev] Re: [GRASS-CVS] hamish: grass6/lib/init init.sh, 1.120, 1.121

Nice Hamish! I love it.

2007/11/6, grass@intevation.de <grass@intevation.de>:

Author: hamish

Update of /grassrepository/grass6/lib/init
In directory doto:/tmp/cvs-serv31353

Modified Files:
        init.sh
Log Message:
Gratuitous use of ASCII art

Index: init.sh

RCS file: /grassrepository/grass6/lib/init/init.sh,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- init.sh 6 Oct 2007 05:04:58 -0000 1.120
+++ init.sh 6 Nov 2007 18:24:43 -0000 1.121
@@ -9,7 +9,7 @@
# Huidae Cho - Korea - grass4u@gmail.com
# Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
# Markus Neteler - Germany/Italy - neteler@itc.it
-# Hamish Bowman - New Zealand - hamish_nospam at yahoo,com
+# Hamish Bowman - New Zealand - hamish_nospam at yahoo,com
# PURPOSE: The source file for this shell script is in
# src/general/init/init.sh. It sets up some environment
# variables and the lock file. It also parses any remaining
@@ -786,6 +786,13 @@
        fi
fi

+echo ' __________ ___ __________ _______________'
+echo ' / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/'
+echo ' / / __/ /_/ / /| | \__ \\__ \ / / __ / / \__ \ '
+echo ' / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ / '
+echo ' \____/_/ |_/_/ |_/____/____/ \____/___//____/ '
+echo
+
if [ -f "$GISBASE/locale/$LCL/etc/welcome" ] ; then
        cat "$GISBASE/locale/$LCL/etc/welcome"
else
@@ -810,6 +817,8 @@
esac

echo "When ready to quit enter: exit"
+echo
+

case "$sh" in

_______________________________________________
grass-commit mailing list
grass-commit@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-commit

--
Martin Landa <landa.martin@gmail.com> * http://gama.fsv.cvut.cz/~landa *

Cool :slight_smile:

Jachym

Martin Landa píše v Út 06. 11. 2007 v 20:36 +0100:

Nice Hamish! I love it.

2007/11/6, grass@intevation.de <grass@intevation.de>:
> Author: hamish
>
> Update of /grassrepository/grass6/lib/init
> In directory doto:/tmp/cvs-serv31353
>
> Modified Files:
> init.sh
> Log Message:
> Gratuitous use of ASCII art
>
>
> Index: init.sh
> ===================================================================
> RCS file: /grassrepository/grass6/lib/init/init.sh,v
> retrieving revision 1.120
> retrieving revision 1.121
> diff -u -d -r1.120 -r1.121
> --- init.sh 6 Oct 2007 05:04:58 -0000 1.120
> +++ init.sh 6 Nov 2007 18:24:43 -0000 1.121
> @@ -9,7 +9,7 @@
> # Huidae Cho - Korea - grass4u@gmail.com
> # Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
> # Markus Neteler - Germany/Italy - neteler@itc.it
> -# Hamish Bowman - New Zealand - hamish_nospam at yahoo,com
> +# Hamish Bowman - New Zealand - hamish_nospam at yahoo,com
> # PURPOSE: The source file for this shell script is in
> # src/general/init/init.sh. It sets up some environment
> # variables and the lock file. It also parses any remaining
> @@ -786,6 +786,13 @@
> fi
> fi
>
> +echo ' __________ ___ __________ _______________'
> +echo ' / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/'
> +echo ' / / __/ /_/ / /| | \__ \\__ \ / / __ / / \__ \ '
> +echo ' / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ / '
> +echo ' \____/_/ |_/_/ |_/____/____/ \____/___//____/ '
> +echo
> +
> if [ -f "$GISBASE/locale/$LCL/etc/welcome" ] ; then
> cat "$GISBASE/locale/$LCL/etc/welcome"
> else
> @@ -810,6 +817,8 @@
> esac
>
> echo "When ready to quit enter: exit"
> +echo
> +
>
> case "$sh" in
>
>
>
> _______________________________________________
> grass-commit mailing list
> grass-commit@grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass-commit
>

--
Jachym Cepicky
e-mail: jachym.cepicky@gmail.com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

BTW: this works better for me:

Index: init.sh

RCS file: /grassrepository/grass6/lib/init/init.sh,v
retrieving revision 1.121
diff -u -r1.121 init.sh
--- init.sh 6 Nov 2007 18:24:43 -0000 1.121
+++ init.sh 6 Nov 2007 20:55:05 -0000
@@ -788,7 +788,7 @@

echo ' __________ ___ __________ _______________'
echo ' / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/'
-echo ' / / __/ /_/ / /| | \__ \\__ \ / / __ / / \__ \ '
+echo ' / / __/ /_/ / /| | \__ \\\\_ \\ / / __ / / \\__ \\ '
echo ' / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ / '
echo ' \____/_/ |_/_/ |_/____/____/ \____/___//____/ '
echo

Jachym Cepicky píše v Út 06. 11. 2007 v 21:10 +0100:

Cool :slight_smile:

Jachym

Martin Landa píše v Út 06. 11. 2007 v 20:36 +0100:
> Nice Hamish! I love it.
>
> 2007/11/6, grass@intevation.de <grass@intevation.de>:
> > Author: hamish
> >
> > Update of /grassrepository/grass6/lib/init
> > In directory doto:/tmp/cvs-serv31353
> >
> > Modified Files:
> > init.sh
> > Log Message:
> > Gratuitous use of ASCII art
> >
> >
> > Index: init.sh
> > ===================================================================
> > RCS file: /grassrepository/grass6/lib/init/init.sh,v
> > retrieving revision 1.120
> > retrieving revision 1.121
> > diff -u -d -r1.120 -r1.121
> > --- init.sh 6 Oct 2007 05:04:58 -0000 1.120
> > +++ init.sh 6 Nov 2007 18:24:43 -0000 1.121
> > @@ -9,7 +9,7 @@
> > # Huidae Cho - Korea - grass4u@gmail.com
> > # Justin Hickey - Thailand - jhickey@hpcc.nectec.or.th
> > # Markus Neteler - Germany/Italy - neteler@itc.it
> > -# Hamish Bowman - New Zealand - hamish_nospam at yahoo,com
> > +# Hamish Bowman - New Zealand - hamish_nospam at yahoo,com
> > # PURPOSE: The source file for this shell script is in
> > # src/general/init/init.sh. It sets up some environment
> > # variables and the lock file. It also parses any remaining
> > @@ -786,6 +786,13 @@
> > fi
> > fi
> >
> > +echo ' __________ ___ __________ _______________'
> > +echo ' / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/'
> > +echo ' / / __/ /_/ / /| | \__ \\__ \ / / __ / / \__ \ '
> > +echo ' / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ / '
> > +echo ' \____/_/ |_/_/ |_/____/____/ \____/___//____/ '
> > +echo
> > +
> > if [ -f "$GISBASE/locale/$LCL/etc/welcome" ] ; then
> > cat "$GISBASE/locale/$LCL/etc/welcome"
> > else
> > @@ -810,6 +817,8 @@
> > esac
> >
> > echo "When ready to quit enter: exit"
> > +echo
> > +
> >
> > case "$sh" in
> >
> >
> >
> > _______________________________________________
> > grass-commit mailing list
> > grass-commit@grass.itc.it
> > http://grass.itc.it/mailman/listinfo/grass-commit
> >
>
>
_______________________________________________
grass-dev mailing list
grass-dev@grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev

--
Jachym Cepicky
e-mail: jachym.cepicky@gmail.com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub

Jachym Cepicky wrote:

BTW: this works better for me:

..

echo ' __________ ___ __________ _______________'
echo ' / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/'
-echo ' / / __/ /_/ / /| | \__ \\__ \ / / __ / / \__ \ '
+echo ' / / __/ /_/ / /| | \__ \\\\_ \\ / / __ / / \\__ \\ '
echo ' / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ / '
echo ' \____/_/ |_/_/ |_/____/____/ \____/___//____/ '
echo

It was my understanding that using 'single quotes' meant that I didn't have to
worry about it being escaped by the shell? The above is shown literally on
Debian/etch.

I think that is a Dash nasty? Surely this is messing up someone's regex scripts
somewhere, and it doesn't smell much like a Bashism.

$ bash
$ echo '\\'
\\
$ dash
$ echo '\\'
\

Is the practical solution to bypass the issue by using "double quotes" and
explicitly double-\\ any intended \\s?

artistic credit goes to the figlet package - Frank, Ian & Glenn's Letters
    http://www.figlet.org
handy online frontend http://www.network-science.de/ascii/

Hamish

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Hamish wrote:

> BTW: this works better for me:
..
> echo ' __________ ___ __________ _______________'
> echo ' / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/'
> -echo ' / / __/ /_/ / /| | \__ \\__ \ / / __ / / \__ \ '
> +echo ' / / __/ /_/ / /| | \__ \\\\_ \\ / / __ / / \\__ \\ '
> echo ' / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ / '
> echo ' \____/_/ |_/_/ |_/____/____/ \____/___//____/ '
> echo

It was my understanding that using 'single quotes' meant that I didn't have to
worry about it being escaped by the shell? The above is shown literally on
Debian/etch.

It isn't the shell; it's "echo" that's the problem.

Whether or not the "echo" command interprets escape sequences by
default varies between implementations.

In particular, the GNU version (both the bash built-in and the
standalone echo program from coreutils) does not conform to the Single
Unix Specification.

The SUS interface doesn't support any options, and escape sequences
are always enabled, while the bash version requires that you use -e to
enable them.

POSIX simply states the the behaviour is implementation-defined if any
argument contains a backslash.

  http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html

  http://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html

I think that is a Dash nasty? Surely this is messing up someone's regex scripts
somewhere, and it doesn't smell much like a Bashism.

$ bash
$ echo '\\'
\\
$ dash
$ echo '\\'
\

Is the practical solution to bypass the issue by using "double quotes" and
explicitly double-\\ any intended \\s?

No. If you want to use a backslash, you'll need to forego "echo" in
favour of e.g. a here document:

cat <<EOF
          __________ ___ __________ _______________
         / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/
        / / __/ /_/ / /| | \__ \\\\_ \\ / / __ / / \\__ \\
       / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ /
       \____/_/ |_/_/ |_/____/____/ \____/___//____/

EOF

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