On 06/01/10 03:42, Agathoklis D. Hatzimanikas wrote: > Hi Andy, > > On Wed, Jan 06, at 12:12 Andrew Benton wrote: >> >> ln -s $(awk '{ print $1; print $2; print $3; print $4; print $5 }' >> /proc/cmdline | sed '/dev/!d;s...@root=/dev/@@') /dev/root >> >> That works fine and causes no problems, even on systems which don't use >> NILFS2, but it isn't pretty. Is there a simpler way to get awk to print >> all the fields at one go? Or would some other tool (perl?) be more >> appropriate? That's the main reason I wrote this email, for a bit of >> scripting advice. > > Using your pattern, maybe you can do something like, > > ln -sv $(sed 's...@root=/dev/\([^ ]*\)....@\1@' /proc/cmdline) /dev/root >
That would work if the root= option was the first argument, but grub puts BOOT_IMAGE= first, giving andy:~$ sed 's...@root=/dev/\([^ ]*\)....@\1@' /proc/cmdline BOOT_IMAGE=/boot/bzImage sda2 andy:~$ -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page