Posted on 02-01-2013 02:09 PM
Has anyone successfully polled the VRAM information through an Extension Attribute? I have been trying the following script without success:
#!/bin/sh
vram='system_profiler -detaillevel mini | grep 'VRAM' | cut -d : -f 2'
echo"<result>$vram</result>"
The command works without a hitch when I use it in Terminal.
Solved! Go to Solution.
Posted on 02-01-2013 02:31 PM
Change your variable quotes from single quotes to grave marks. Grave marks are the button next to the number 1 button on your keyboard. And you will want to add a space after echo.
#!/bin/sh
vram=`system_profiler -detaillevel mini | grep 'VRAM' | cut -d : -f 2`
echo "<result>$vram</result>"
That works for me.
Posted on 02-01-2013 02:31 PM
Change your variable quotes from single quotes to grave marks. Grave marks are the button next to the number 1 button on your keyboard. And you will want to add a space after echo.
#!/bin/sh
vram=`system_profiler -detaillevel mini | grep 'VRAM' | cut -d : -f 2`
echo "<result>$vram</result>"
That works for me.
Posted on 02-03-2013 07:52 PM
Hi. You could shorten the time it takes to get this piece of data by doing the following instead-
vram=`system_profiler SPDisplaysDataType | grep "VRAM" | cut -d : f 2`
Pulling an entire System Profiler report is a bit slow. I personally try not to use system_profiler because of that.
Posted on 02-04-2013 05:49 AM
Thanks Steve! That fixed the issue for me. Mike, using the SPDisplayDataType is indeed much faster and I do believe I will use this instead of -detaillevel mini. Thanks to both of you!