|
| From: | Paul Jarc |
| Subject: | Re: a question about {} of xargs |
| Date: | Fri, 18 Feb 2005 12:01:47 -0500 |
| User-agent: | Gnus/5.110003 (No Gnus v0.3) Emacs/21.4 (gnu/linux) |
<gan_xiao_jun@yahoo.com> wrote:
> echo 0x04abcdef|xargs -i printf "%x\n"
> (({}-0x043000000)
I assume that was supposed to be "$(({}-0x043000000))". The problem
with that is that bash processes the arithmetic expansion before
invoking xargs. Try this:
echo 0x04abcdef | xargs -i bash -c 'printf "%x\n" "$(({}-0x043000000))"'
news:comp.unix.shell is a good place to find help with writing
scripts.
paul
| [Prev in Thread] | Current Thread | [Next in Thread] |