That is a very clever trick. Saved for future reference. Thank you Jason.<br><br><div><span class="gmail_quote">On 7/19/07, <b class="gmail_sendername">Jason Kohles</b> <<a href="mailto:email@jasonkohles.com">email@jasonkohles.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Jul 19, 2007, at 10:07 AM, Ed Brown wrote:<br><br>>> Use python instead.
<br>><br>> Or perl.  You can substitute any parameter name you want from /proc/<br>> cmdline, in place of the string 'ip' in the example given earlier:<br>><br>>  ip=`cat /proc/cmdline |perl -e 'if (<> =~ /\sip=(.*?)\s/) {print
<br>> $1}'`<br>><br>> ESXIP=`cat /proc/cmdline |perl -e 'if (<> =~ /\sESXIP=(.*?)\s/)<br>> {print $1}'`<br>><br><br>Or you can use the -n option to perl, which makes it work quite a bit<br>
like awk anyway (see the perlrun man page)...<br><br>ESXIP=`perl -ne '/ESXIP=(\S+)/ && print $1' /proc/cmdline`<br><br><br>What I usually do though, is just exploit bash to do the whole<br>thing.  Stick this at the top of a %pre/%post script, and it will
<br>take anything of the form var=value from /proc/cmdline and turn it<br>into a variable you can use directly...<br><br>        set -- `cat /proc/cmdline`<br>        for I in $*; do case "$I" in *=*) eval $I;; esac; done
<br><br><br>You can try it from the command line to see how it works...<br><br>[root@dev1-mgmt-01 ~]# cat /proc/cmdline<br>ro root=/dev/SystemVG/RootLV<br>[root@dev1-mgmt-01 ~]# set -- `cat /proc/cmdline`<br>[root@dev1-mgmt-01
 ~]# for I in $*; do case "$I" in *=*) eval "$I";;<br>esac; done<br>[root@dev1-mgmt-01 ~]# echo $root<br>/dev/SystemVG/RootLV<br><br>--<br>Jason Kohles<br><a href="mailto:email@jasonkohles.com">email@jasonkohles.com
</a><br><a href="http://www.jasonkohles.com/">http://www.jasonkohles.com/</a><br>"A witty saying proves nothing."  -- Voltaire<br><br><br>_______________________________________________<br>Kickstart-list mailing list
<br><a href="mailto:Kickstart-list@redhat.com">Kickstart-list@redhat.com</a><br><a href="https://www.redhat.com/mailman/listinfo/kickstart-list">https://www.redhat.com/mailman/listinfo/kickstart-list</a><br></blockquote></div>
<br>