[CentOS] parsing /proc/cmdline
Stephen Harris
lists at spuddy.orgFri Mar 7 16:20:30 UTC 2008
- Previous message: [CentOS] parsing /proc/cmdline
- Next message: [CentOS] parsing /proc/cmdline
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I didn't see the original, so I'm jumping in here... > >Hi - I am not an expert at shell script writing. > > >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. This should work with bash/ksh or similar shells a=$(cat /proc/cmdline) a=${a##*ks=http://} a=${a%%/*} echo $a -- rgds Stephen
- 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