[ale] Need AWK Guru input

Dennis Ruzeski denniruz at gmail.com
Mon Aug 1 11:17:33 EDT 2011


Something like this?

cat /etc/redhat-release |awk  '/release/ { for (x=1;x<=NF;x++) if
($x~"release") print $(x+1) }'

--Dennis



On Mon, Aug 1, 2011 at 10:52 AM, Chuck Payne <terrorpup at gmail.com> wrote:
> Guys,
>
> I am working on adding servers to my Satellite server, and I like to
> be able to get in with a script and call on the following
>
> /etc/redhat_release
>
> But I only want to get the number, so that I can see if it RHEL 4 or
> 5, I been trying to do with awk, but I am not able to get anything,
> what is the best way to only put numbers?
>
> --
> (678) 636-9678
> -----------------------------------------
> Discover it! Enjoy it! Share it! openSUSE Linux.
> -----------------------------------------
> openSUSE -- en.opensuse.org/User:Terrorpup
> openSUSE Ambassador/openSUSE Member
> skype,twiiter,identica,friendfeed -- terrorpup
> freenode(irc) --terrorpup/lupinstein
> Register Linux Userid: 155363
>
> Have you tried SUSE Studio? Need to create a Live CD,  an app you want
> to package and distribute , or create your own linux distro. Give SUSE
> Studio a try. www.susestudio.com.
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>



More information about the Ale mailing list