Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: strace completion (Re: grouping/joining _values)
- X-seq: zsh-users 12928
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: strace completion (Re: grouping/joining _values)
- Date: Sat, 14 Jun 2008 08:41:54 -0700
- In-reply-to: <20080614084949.GQ5113@xxxxxxxxxxxxxxx>
- 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> <20080614084949.GQ5113@xxxxxxxxxxxxxxx>
On Jun 14, 9:49am, Stephane Chazelas wrote:
}
} 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.
Clever as that seems to be, though, it doesn't work on my CentOS 4 system.
Using "ltrace -e printf $tmp ..." without the 2> shows a bunch of printf
calls, but none of the output ever appears.
[... lots omitted ...]
printf("%s\n", "shmdt") = -1
printf("%s\n", "shmget") = -1
printf("%s\n", "shmctl") = -1
strace: invalid system call `%s
'
+++ exited (status 1) +++
If I pass a valid system call name instead of $'%s\n' then I get the
usage message, so I think changing the label from strcmp to printf is
not replacing the underlying function that is actually called.
Incidentally for a shorter eval-less way to get the same non-result:
x() { chmod u+x $1; $1 -e $'%s\n' 2> /dev/null | sort -u }
x =(zmodload zsh/mapfile;
print -rn -- ${mapfile[/usr/bin/strace]//strcmp/printf})
Messages sorted by:
Reverse Date,
Date,
Thread,
Author