Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

nelly22

macrumors 6502
Original poster
Sep 29, 2009
366
5
Is there any way in AppleScript/Unix to get path to virtual memory folder (/private/var/vm), similar way than (path to desktop)?

We have many Macs and some Macs keep virtual memory in non standard place.
 
Code:
ps -axo command | awk '$1 == "/sbin/dynamic_pager" { print $3 }'

or maybe

Code:
xpath "/plist/dict/key[text()='ProgramArguments']/following::array/string[3]/text()" < /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

Neither are terribly robust but depending on your needs might do.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.