Hi all
I'm jumping into Cocoa Dialog and have modified an example from @mm2270 , thanks!,
i'd like to be able to display all of the output from softwareupdate -i in the Cocoa Dialog window but also write that info to a log file (which is later used to check success, if a restart is required and also so i have a record).
here's what i'm testing with, if i add >> "$logpath" then the log file gets written to but Cocoa Dialog doesn't display the output fully, any advise is appreciated!
cdPath="/Applications/Utilities/CocoaDialog.app/Contents/MacOS/CocoaDialog"
## Create the name pipe input for the progressbar
rm -f /tmp/hpipe
mkfifo /tmp/hpipe
sleep 0.2
## Display indeterminate progress bar
echo "Displaying progress bar window."
"$cdPath" progressbar --indeterminate --title "Installing Apple Updates" --text "Progress..."
--posX "right" --posY "top" --width 225 --float --icon info < /tmp/hpipe &
## Send progress through the named pipe
exec 3<> /tmp/hpipe
softwareupdate -i "$Install" | while read line; do
outPut=$( echo "$line" )
echo "$outPut" >&3 #displays output properly
#echo "$outPut" >&3 >> "$logpath" # writes to log file as needed but not displaying text
done
## Wait 1 second before shutting off progressbar
sleep 1
# Turn off progress bar by closing file descriptor 3 and removing the named pipe
echo "Closing progress bar."
exec 3>&-
rm -f /tmp/hpipe