Hi, there is a small syntactic detail in fish that might be worth discussing.
Right now, the characters ';' and newline are considered as
equivalent, both unconditionally end a command. This makes it
impossible to make a single pipeline span multiple lines, i.e. you
can't write:
for h in (cat /etc/dupload.conf $HOME/.dupload.conf ^/dev/null |
awk -F "=" '/('\''fqdn'\''| *fqdn *=)/ {print $2}' |
cut -d"'" -f2 | cut -d'"' -f2);
set hosts $hosts $h;
end
and instead end up with either
for h in (cat /etc/dupload.conf $HOME/.dupload.conf ^/dev/null |awk -F
"=" '/('\''fqdn'\''| *fqdn *=)/ {print $2}' | cut -d"'" -f2 | cut
-d'"' -f2);
set hosts $hosts $h;
end
or
set -l cat_args "/etc/dupload.conf $HOME/.dupload.conf ^/dev/null"
set -l awk_args "-F \"=\" '/(\\'fqdn\\'| *fqdn *=)/ {print $2}'"
set -l cut1_args -d"'" -f2
set -l cut2_args -d'"' -f2
for h in (cat $cat_args | awk $awk_args | cut $cut1_args | cut $cut2_args);
set hosts $hosts $h;
end
I'll admit that I think the first version is easier to read, though
perhaps not by a wide margin. On the other hand, knowing that a single
command takes up a single line makes for easier parsing. It's easy to
miss that the following is a single pipeline:
cat foo|sed 's|foo|bar|'|
#
# wc counts the number of matches
#
wc -l
Also, changing the fish syntax means that either a newline is slightly
different from a ';', which I am strongly against because I dislike
having strongly related but not identical concepts, or accepting the
following as a perfectly legal pipeline:
foo |; bar
--
Axel
N�HY隊X���'���u���[�������
ަ�k��!���W�~�鮆�zk��C� [EMAIL PROTECTED],����a{�
��,�H��4�m�����Z��jY�w��ǥrg