Skip to main content
Solved

Script Help for Extenstion Attribute to collect String

  • October 10, 2014
  • 2 replies
  • 22 views

Forum|alt.badge.img+6

I am trying to collect a string from the OEAO plist. The script I wrote works via ARD, but does not work as an EA in Casper. Any ideas as to what I am doing wrong? Is there a better way to collect the string for the destinationFolder Key?

#!/bin/sh

loggedInUser=/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'

/usr/libexec/PlistBuddy -c "print :destinationFolder" /Users/$loggedInUser/Library/Preferences/com.softhing.oeao3.plist

Thanks!

Best answer by brad

For extension attributes you will need to put the output in between results tags.

echo "<result>$result</result>"

So something like this:

#!/bin/sh

loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`

destinationFolder=`/usr/libexec/PlistBuddy -c "print :destinationFolder" /Users/$loggedInUser/Library/Preferences/com.softhing.oeao3.plist`

echo "<result>$destinationFolder</result>"

Good luck!

2 replies

Forum|alt.badge.img+15
  • Contributor
  • Answer
  • October 10, 2014

For extension attributes you will need to put the output in between results tags.

echo "<result>$result</result>"

So something like this:

#!/bin/sh

loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`

destinationFolder=`/usr/libexec/PlistBuddy -c "print :destinationFolder" /Users/$loggedInUser/Library/Preferences/com.softhing.oeao3.plist`

echo "<result>$destinationFolder</result>"

Good luck!


Forum|alt.badge.img+6
  • Author
  • Contributor
  • October 14, 2014

That worked. Thank you!!