Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: parse error in process substitution
- X-seq: zsh-users 13444
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: parse error in process substitution
- Date: Mon, 10 Nov 2008 14:55:02 +0000
- In-reply-to: <20081110144259.GA27493@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: CSR
- References: <20081106150224.GA10992@xxxxxxxxxx> <081106082517.ZM27477@xxxxxxxxxxxxxxxxxxxxxx> <20081110082152.GA9563@xxxxxxxxxx> <20081110142850.0add2680@news01> <200811101432.mAAEWpqO020091@xxxxxxxxxxxxxx> <20081110144259.GA27493@xxxxxxxxxx>
On Mon, 10 Nov 2008 15:42:59 +0100
Louis-David Mitterrand <vindex+lists-zsh-users@xxxxxxxxxxx> wrote:
> Thanks for your suggestion Peter. But when invoking root-tail on
> several log files (typical usage) it doesn't scale:
>
> root-tail --geometry 1920x1200+0+0 --wordwrap \
> ~/.xsession-errors,yellow, \
> /var/log/syslog,white, \
> /var/log/apache2/error.log,orange, \
> <(ssh root@xxxxxxxxxxxxxx tail -F /var/log/kern.log),red, \
> <(ssh root@xxxxxxxxxxxxxx tail -F /var/log/apache2/error.log),pink, &
Looks like you should be able to do something like (only partially tested):
root-tail-sub() {
integer i
local -a args
for (( i = 1; i <= ${#argv}; i++ )); do
args+=($argv[i])
if [[ ${argv[i]} = (/dev|/proc)/* ]]; then
args[-1]+=$argv[++i]
fi
done
root-tail "${args[@]}"
}
root-tail-sub --geometry 1920x1200+0+0 --wordwrap \
~/.xsession-errors,yellow, \
/var/log/syslog,white, \
/var/log/apache2/error.log,orange, \
<(ssh root@xxxxxxxxxxxxxx tail -F /var/log/kern.log) ,red, \
<(ssh root@xxxxxxxxxxxxxx tail -F /var/log/apache2/error.log) ,pink, &
Note the spaces after the <(...) substitutions. The function assumes that
anything substituted to a file name beginning /proc/ or /dev/ has come from
that and appends the following argument.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author