[GRASS-dev] Re: [GRASS-SVN] r30420 -
grass/trunk/scripts/v.db.renamecol
Ivan Shmakov
ivan at theory.asu.ru
Sun Mar 2 13:44:29 EST 2008
>>>>> Hamish <hamish_b at yahoo.com> writes:
[...]
>>> I darkly remember that some "wc" programs insert odd spaces which
>>> would break the script.
>> I haven't heard of it. Maybe you are right. Let's ask on the dev ML.
>> Thoughts, Anybody?
> 'wc -c filename' will produce output like: '17 filename' (needing awk
> or cut) while 'wc -c < filename' or 'cat filename | wc -c' will
> produce output like: '17'. Maybe that is the dark memory?
--cut: http://opengroup.org/onlinepubs/007908799/xcu/wc.html--
If no input file operands are specified, no name will be written and
no blank characters preceding the pathname will be written.
--cut: http://opengroup.org/onlinepubs/007908799/xcu/wc.html--
[...]
> and r30418: v.db.dropcol
> @@ -91,5 +80,5 @@
> exitprocedure()
> {
> - g.message -e 'User break!'
> + g.message -e "User break!"
> cleanup
> exit 1
In general, I'd recommend using single quotes for text strings,
unless there's a reason to use double ones (such as when one
needs to substitute a variable within the text.)
> "!" is a special shell char and must be quoted in 'single quotes'.
> GRASS> g.message -e "this will not work!, ok?"
> bash: !,: event not found
It is not quite so. One may think of `!' as of a ``Bash special
char''. Compare, e. g.:
bash $ echo "hello, world!"
bash: !": event not found
bash $
and
dash $ echo "hello, world!"
hello, world!
dash $
Moreover, it's an optional feature even in Bash (check the
``History expansion'' section in bash(1)):
bash $ set +H
bash $ echo "hello, world!"
hello, world!
bash $
and it is /not/ enabled by default when in a non-interactive
mode:
bash $ bash -c 'echo "hello, world!"'
hello, world!
bash $
In particular, this feature never gets enabled by default for
Shell scripts.
More information about the grass-dev
mailing list