shell-cmdline(3)
cmdline_foreach, cmdline_get - parses and get values from /proc/cmdline
- cmdline_foreach "proc-cmdline-data" "handler-function"
- cmdline_get "name-for-result" "name" ["proc-cmdline-data"]
Collection of functions to parse and get values from /proc/cmdline
. Because /proc/cmdline
isn't
just shell command line we need to parse it differently. This string can have repetitions of parameters,
and only the last value makes sense, parameter names may contain characters illegal characters
for variables in a shell.
Function runs handler-function for each variable in proc-cmdline-data. Returns nothing.
Function finds specified by name variable in /proc/cmdline
or in proc-cmdline-data
and stores result into variable passed by name-for-result.
Usage example:
read cmdline < /proc/cmdline
cmdline_get 'initrd_value' 'initrd' "$cmdline"
echo "$initrd_value"
or
cmdline_get 'initrd_value' 'initrd'
echo "$initrd_value"
Authors and contributors of the programs included in the libshell package are listed in the COPYING file.
Report bugs to the authors.