[D-community-offtopic] how to quote the pipe symbol in shell scripts?
Jochen Schulz
ml at well-adjusted.de
Wed May 25 12:08:01 UTC 2011
Kamaraju S Kusumanchi:
> $cat quote_pipe_symbol.sh
> #! /bin/sh
>
> command="tail -n 3 cols.txt | cut -f 2-3 -d ','"
> echo $command
> $command
I cannot tell why executing "$command" doesn't work, but running "eval
$command" works for me.
BTW: Be aware that your shebang-line points to /bin/dash by default on
Debian. Your script will break if you use bashisms in the future.
J.
--
I wear a lot of leather but would never wear fur.
[Agree] [Disagree]
<http://www.slowlydownward.com/NODATA/data_enter2.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/d-community-offtopic/attachments/20110525/4652664c/attachment.pgp>
More information about the D-community-offtopic
mailing list