To mount my RAM drive I am using:
diskutil erasevolume HFS+ 'RAM_Disk' `hdiutil attach -nomount ram://51200`
To hide it I'm using:
chflags hidden /Volumes/RAM_Disk'
However the ram drive still appears in Finder's sidebar.
I do not want all the 'hard drives' not to be listed under devices in Finder's sidebar, just this particular RAM drive. Manually one can just drag it off the sidebar but I need to do this programmatically preferably with Shell Bash and if not that then with applescript.
I have tried changing the com.apple.sidebarlists.plist but this doesn't help.
I need this to work also in El Capitan.