Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strace completion (Re: grouping/joining _values)
- X-seq: zsh-users 12927
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: strace completion (Re: grouping/joining _values)
- Date: Sat, 14 Jun 2008 09:49:49 +0100
- In-reply-to: <20080613235914.GP5113@xxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20080607193937.GA14443@xxxxxxxxxxxxxxxx> <20080613002731.GA11526@xxxxxxxxxxxxxxxx> <20080613113302.GA40053@xxxxxxxxxxxxxxxxxxxx> <20080613121226.GA18890@xxxxxxxx> <20080613131851.GA12764@xxxxxxxxxxxxxxxxxxxx> <20080613160458.GM5113@xxxxxxxxxxxxxxx> <20080613191905.GN5113@xxxxxxxxxxxxxxx> <20080613235914.GP5113@xxxxxxxxxxxxxxx>
On Sat, Jun 14, 2008 at 12:59:14AM +0100, Stephane Chazelas wrote:
> On Fri, Jun 13, 2008 at 08:19:06PM +0100, Stephane Chazelas wrote:
> > On Fri, Jun 13, 2008 at 05:04:58PM +0100, Stephane Chazelas wrote:
> > [...]
> > > > > > Are there any other useful strategies for extracting the real list of
> > > > > > syscalls at runtime, so that on systems which package up the same
> > > > > > version of zsh for N years the list doesn't grow stale?
> > [...]
> > > You could get the list from strace itself with:
> > >
> > > ltrace -e strcmp strace -e xxx |& awk -F\" '
> > > /xxx/&&/strcmp/{print $4}' | sort -u
> [...]
>
> An other one that doesn't require ltrace:
>
> zmodload zsh/mapfile
> tmp==(print -rn -- ${mapfile[/usr/bin/strace]//strcmp/printf})
> chmod u+x $tmp
> $tmp -e $'%s\n' 2> /dev/null | sort -u
> rm -f $tmp
[...]
Or to let zsh remove the temp file:
zmodload zsh/mapfile
eval 'tmp=(' =(
print -rn -- ${mapfile[/usr/bin/strace]//strcmp/printf}) ')
chmod u+x $tmp
$tmp -e $'"'%s\n'"' 2> /dev/null | sort -u'
Assuming the temp file name generated by zsh won't have special
characters in it.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author