Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#/bin/ksh
PAPA_NUMBER=$RANDOM
echo 'Initial Values From Parent Script'
echo 'PAPA_NUMBER='$PAPA_NUMBER
echo 'CHILD_NUMBER='${CHILD_NUMBER}
echo 'CHILD_COLOR='${CHILD_COLOR}
#Start child process with two-way pipe
child |&
while [[ ${CHILD_NUMBER} != ${PAPA_NUMBER} || -z ${CHILD_COLOR} ]] do
if [[ -z ${CHILD_NUMBER} ]] then
QUESTION='CHILD_NUMBER'
echo '-----------------------------------'
echo "Ask Child value of ${QUESTION}"
print -p "INT#${QUESTION}"
elif [[ -z ${CHILD_COLOR} ]] then
QUESTION='CHILD_COLOR'
echo '-----------------------------------'
echo "Ask Child to set Parent value of ${QUESTION}"
print -p "SET#${QUESTION}"
elif [[ ${CHILD_NUMBER} != ${PAPA_NUMBER} && -n ${CHILD_NUMBER} ]] then
QUESTION='CHILD_NUMBER'
echo '-----------------------------------'
echo "Tell Child to change its value of ${QUESTION}"
echo 'PAPA_NUMBER='$PAPA_NUMBER
echo 'CHILD_NUMBER='${CHILD_NUMBER}
echo 'CHILD_COLOR='${CHILD_COLOR}
print -p CMD#CHILD_NUMBER=${PAPA_NUMBER}
echo '-----------------------------------'
echo "Ask Child value of ${QUESTION}"
print -p "INT#${QUESTION}"
fi
read -p CHILD_MSG
REPLY_TYPE=$(echo $CHILD_MSG|cut -d# -f1)
CHILD_REPLY=$(echo $CHILD_MSG|cut -d# -f2)
case $REPLY_TYPE in
INFO*) eval "${QUESTION}"'='${CHILD_REPLY};;
CMD*) eval ${CHILD_REPLY};;
esac
echo 'PAPA_NUMBER='$PAPA_NUMBER
echo 'CHILD_NUMBER='${CHILD_NUMBER}
echo 'CHILD_COLOR='${CHILD_COLOR}
done
print -p 'END'
wait
echo '-----------------------------------'
echo "Final Values From Parent "
echo 'PAPA_NUMBER='$PAPA_NUMBER
echo 'CHILD_NUMBER='$CHILD_NUMBER
echo 'CHILD_COLOR='$CHILD_COLOR
#!/bin/ksh
CHILD_COLOR='PURPLE'
CHILD_NUMBER=$RANDOM
while [[ $PAPA_MSG != END ]] do
read PAPA_MSG
REPLY_TYPE=$(echo $PAPA_MSG|cut -d# -f1)
PAPA_REQ=$(echo $PAPA_MSG|cut -d# -f2)
case $REPLY_TYPE in
INT*) echo 'INFO#'$(eval echo \$${PAPA_REQ});;
SET*) echo 'CMD#'${PAPA_REQ}'='$(eval echo \$${PAPA_REQ});;
CMD*) eval ${PAPA_REQ};;
esac
done