[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnuwin32
From: |
Steve |
Subject: |
Re: gnuwin32 |
Date: |
18 Oct 2006 00:18:02 -0700 |
User-agent: |
G2/1.0 |
Paul Jarc wrote:
> "Steve" <steve.mayes@gmail.com> wrote:
> > /CODE/
> >
> > >ping -n 1 whrcsdp05922 | awk "/TTL/ {print $3}" | awk -F: "{print
> > $1}" | xargs --verbose set pcip=
> >
> > /ENDCODE/
> >
> > The result is:
> >
> > set pcip= 10.60.1.77
> > xargs: set: No such file or directory
>
> set is a command shell builtin, and xargs can only run external
> commands. Something like this might work:
>
> ping -n 1 whrcsdp05922 |
> awk "/TTL/ {print $3}" |
> awk -F: "{print \"set pcip=\" $1}" |
> cmd
>
> Of course, the variable will be set only in that invocation of cmd, so
> whatever depends on the variable should probably be included in the
> commands written by the second awk.
>
>
> paul
Paul,
thanks for the explanation - it makes sense and in some ways is obvious
now that it's been pointed out to me. I'll play a little with the
above and see what I can come up with.