# Copyright 1999-2008 Gentoo Foundation; 2008 Chris Gianelloni, Andrew Gaffney
# Distributed under the GPL v2
+ 14 Nov 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/initrd.scripts:
+ Simplify implementation of parse_opt in linuxrc
+
14 Nov 2008; Andrew Gaffney <agaffney@gentoo.org> defaults/initrd.scripts,
defaults/linuxrc:
Small cleanups in unionfs code
echo -ne "\033[0G\033[0K"
}
-strlen() {
- if [ -z "$1" ]
- then
- echo "usage: strlen <variable_name>"
- die
- fi
- eval echo "\${#${1}}"
-}
-
parse_opt() {
case "$1" in
*\=*)
- local key_name="`echo "$1" | cut -f1 -d=`"
- local key_len=`strlen key_name`
- local value_start=$((key_len+2))
- echo "$1" | cut -c ${value_start}-
+ echo "$1" | cut -d= -f2-
;;
esac
}