Notice the space between the two strings in the variable $pmon:
pmon=`ps -fu oracle | grep pmon_$1 | grep -v grep | awk '{ print $8}'`
echo $pmon
ora_pmon_cdb ora_pmon_mydb01
for pname in $pmon; do
echo $pname
done
Output:
ora_pmon_cdb ora_pmon_mydb01The for loop construct seem to take space as a delimter by default, so in this case it works out well.
No comments:
Post a Comment