Re: Accessing boot: prompt options inside KS script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Excessive sloping matchstick substitutions in sed make my eyes water - I
> find it conceptually easier to break at whitespace into separate lines:

I just use bash itself.  It's a little more typing, but more adaptable
and readable.

set -- $(cat /proc/cmdline)
for arg in "$@"; do
    case $arg in
        ip=*)
            ip=${arg#ip=}
            ;;
    esac
done

Of course, you could use --interpreter /usr/bin/python, in which case,
you'd have:

for arg in open('/proc/cmdline').read().split():
    if arg[0:3] == "ip=":
        ip = arg[3:]


[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux