script help
Tim H.
bizdev at pwnspeak.com
Tue Aug 24 17:02:04 UTC 2010
> Hi chaps,
>
> Can someone help me with a script/grep syntax please? I have a string
> within an HTML file downloaded by wget.
>
> The string is "Antivirus Pattern - Win vx.yyy.z"
>
> I need to find that string and then pass "xyyyz" to the console pass to
> the next command in the chain (note the lack of v and the ".").
>
> Any ideas how I can do this ?
>
> Olly
>
IMHO after you have the string "Antivirus Pattern - Win vx.yyy.z" and
you are confident it is always in that pattern you could pipe your
initial command through this (I echo'd the initial output to represent
your command):
% echo "Antivirus Pattern - Win vx.yyy.z"|awk '{print$5}' | tr -d '.' |
cut -c 2-
xyyyz
With the string of commands you should be able to store the output into
a variable to be used by other commands.
Tim
More information about the ubuntu-users
mailing list