[CentOS] parsing /proc/cmdline
Filipe Brandenburger
filbranden at gmail.comFri Mar 7 15:54:49 UTC 2008
- Previous message: [CentOS] parsing /proc/cmdline
- Next message: [CentOS] parsing /proc/cmdline
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Mar 7, 2008 at 10:35 AM, Jerry Geis <geisj at pagestation.com> wrote: > If /proc/cmdline looks like > > option1 option2 ... ks=http://192.168.1.8/ks/ks.cfg option3 option 4 ... > > How can I get the 192.168.1.8 out of this cmdline. Cryptic but does the job: $ cat /tmp/cmdline option1 option2 ... ks=http://192.168.1.8/ks/ks.cfg option3 option 4 ... $ perl -lane 'm#^ks=.*//((\d+\.){3}\d+)/#&&print($1)&&exit for at F' /tmp/cmdline 192.168.1.8 $ Obviously, you should use /proc/cmdline instead of the file in /tmp as I used. Filipe
- Previous message: [CentOS] parsing /proc/cmdline
- Next message: [CentOS] parsing /proc/cmdline
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list