Posted on 09-29-2014 06:56 AM
Anybody using eracent? I'm looking for a way to pull the version of the agent installed, but it doesn't show up under plugins or installed applications. I could scope off the installed package, but was hoping for a better way to check against the app as that can get messy once multiple packages are brought in.
Posted on 09-29-2014 10:52 AM
Never used it before but perhaps it has some info in a plist located within the app/agent.
Example when I check Microsoft Excels version I run:
defaults read /Applications/Microsoft Office 2011/Microsoft Excel.app/Contents/version.plist CFBundleShortVersionString
Perhaps a starting point? Hope you get it figured out!
Posted on 09-29-2014 12:39 PM
it doesn't seem to have a plist file, i found an XML file that does have the Version= that I need, but not sure how to extract the data.
Posted on 09-29-2014 12:41 PM
just guessing,
awk -F= '/Version/{print $2"}' xmlfile
Posted on 09-29-2014 12:52 PM
@nessts beat me to it. Was on a conference call and when I finished (apparently I didn't have enough fight in me to be on the call and hit the "Post It" button) he already answered it.
Hope is one liner helps out. If not please post the xml or relative portion.
Posted on 09-29-2014 01:04 PM
I appreciate you guys taking the time to look at this!
<?xml version="1.0" encoding="utf-8" ?>
<ScannerConfig
Version="9.8.0.69" >
<Scanner>
<!--
when I tried the awk command it returned this...(note, I tried with the " as shown in your example, as well as some variations there-of to get it to work; all returned the below behavior
sudo awk -F='/Version/{print $2}' /private/var/Eracent/EPA/conf/ScannerConfig.xml
awk: syntax error at source line 1
context is
>>> /private/var/Eracent/EPA/conf/ScannerConfig. <<< xml
awk: bailing out at source line 1
Posted on 09-29-2014 01:25 PM
awk -F'"' /Version/{print $2}' /path/to/xmlfile
should do it.
Edit: BTW, the reason you were getting that error is because you weren't including a space between the -F= and '/Version/{print $2}' Look closely at what @nessts][/url posted and you'll see the space between them.