Setting and unsetting the IFS variable is tricky. To be on the
safe side we should always reset the IFS variable to its original
value after parsing.
Signed-off-by: Hannes Reinecke <hare@suse.de>
#!/bin/sh
for dasd_arg in $(getargs rd.dasd= -d rd_DASD= DASD=); do
(
+ local OLDIFS="$IFS"
IFS=","
set -- $dasd_arg
+ IFS="$OLDIFS"
echo "$@" | normalize_dasd_arg >> /etc/dasd.conf
)
done
;;
esac
if [ -n "$ccw_arg" ] ; then
+ OLDIFS="$IFS"
IFS="-"
set -- $ccw_arg
+ IFS="$OLDIFS"
create_udev_rule $2
fi
)
for dasd_arg in $(getargs rd.dasd=); do
(
+ OLDIFS="$IFS"
IFS=","
set -- $dasd_arg
- unset IFS
+ IFS="$OLDIFS"
while (($# > 0)); do
case $1 in
autodetect|probeonly)
;;
*-*)
range=$1
+ OLDIFS="$IFS"
IFS="-"
set -- $range
start=${1#0.0.}
shift
end=${1#0.0.}
shift
- unset IFS
+ IFS="$OLDIFS"
for dev in $(seq $(( 16#$start )) $(( 16#$end )) ) ; do
create_udev_rule $(printf "0.0.%04x" "$dev")
done
for zfcp_arg in $(getargs rd.zfcp); do
(
+ OLDIFS="$IFS"
IFS=","
set $zfcp_arg
+ IFS="$OLDIFS"
create_udev_rule $1 $2 $3
)
done
;;
esac
if [ -n "$ccw_arg" ] ; then
+ OLDIFS="$IFS"
IFS="-"
set -- $ccw_arg
+ IFS="$OLDIFS"
_wwpn=${4%:*}
_lun=${4#*:}
create_udev_rule $2 $wwpn $lun