Friday, March 02, 2012

dealing with spaces in shell script for loops


SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for policy in `/usr/SD/bin/nrcmd -r -N doofus -P 1234 policy listnames`
do
        echo "$policy"
done
IFS=$SAVEIFS

No comments:

Post a Comment