I would like to know the possibility of installing/configuring SAS 9.4 M5 GRID and SAS 9.4 M6 GRID in the same Linux environment. Someone who has done this already please provide some valuable suggestions.
this is a not supported configuration of SAS Platform, therefore you can try in a POC environment but you cannot expect any support on it, therefore surely not for any Production-related environment, including Development.
Technically it can be possible, as long as it is Linux/UNIX, never in a Windows environment (Windows registry). But, as said, you would be on your own.
Beware that sharing file system with more than one environment it will just degrade performance, create a bunch of unnecessary dependencies for maintenance, fail-over and high availability.
Long story short: my advise, just discard this option business-wise. If you want and can invest on it on your own time and resources, I admire that, then give it a go, as we are nothing without a healthy curiosity and "The Power to Know".
If you are asking whether you can use a single grid to run jobs from separately deployed SAS 9.4M5 and SAS 9.4M6 environments, the answer is yes.
If you are asking whether you can use multiple installs of grid software on the same machines to run separately deployed SAS 9.4M5 and SAS 9.4M6, the answer is no. Two resource managers on the same machines cause scheduling problems.