Hi,
Can anyone think of a nicer way to do the following, I'm creating a lpar autobuild script, got to the point where I need to check if the lpar profile already exists, is it created in line with a config file, if it is let the scripts that follow run (Add vhost / rootvg), if not stop.
Had a play with arrays and while but didn't get anywhere useful. So went for the following, but it looks nasty.
Any clever ideas.....?
Mike
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
Can anyone think of a nicer way to do the following, I'm creating a lpar autobuild script, got to the point where I need to check if the lpar profile already exists, is it created in line with a config file, if it is let the scripts that follow run (Add vhost / rootvg), if not stop.
Had a play with arrays and while but didn't get anywhere useful. So went for the following, but it looks nasty.
Code:
if [ "name=${_PROFILE_NAME}" = `grep name=${_PROFILE_NAME} filename.txt` ; then
echo "ok"
continue
else
echo "No Match"
exit
fi
if [ "lpar_name=${_LPAR_NAME}" = `grep lparname=${_LPAR_NAME} filename.txt ; then
echo "ok"
continue
else
echo "No Match"
exit
fi
Repeat for 20 other Vars
Any clever ideas.....?
Mike
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."