[sclug] sclug Digest, Vol 67, Issue 10

David Given dg at cowlark.com
Wed Apr 22 20:42:17 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Neil Haughton wrote:
[...]
> Is there a simple way of changing
> 
> shnjoin -o $1 *
> 
> to wrap the filenames in quotes, or at least have the effect of avoiding the
> spaces causing parsing problems?

Yep:

shnjoin -o "$1" "$@"

"$@" is special syntax that causes the arguments to be expanded in
quotes separately.

In general, though, I'd have to recommend not using bash if you can
possibly help it --- it's a *lousy* programming language, and will drive
you insane as soon as you run into anything the slightest bit
complicated. Even its weird edge conditions have weird edge conditions.
If you want a shell for programming in, rc is vastly nicer, having sane
C-like command flow syntax, proper lists and a vastly simpler grammar.
Alas, no arithmetic, though.

- --
???? ?????????????? ????? http://www.cowlark.com ?????
?
? "People who think they know everything really annoy those of us who
? know we don't." --- Bjarne Stroustrup
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJ74Elf9E0noFvlzgRAh4DAKDac66HHKRKOoKfrnaetZN6Sm12MACgtB/l
EBxNRA1wSy6NqcgthhB2veM=
=wymg
-----END PGP SIGNATURE-----



More information about the Sclug mailing list