1. I am trying to post the relevant items in the related forum. Should i just put everything in the Shell Scripting forum?
2-4. I am coding for unknown OS. The reason for the $COMMAND is because at the top of my scripts i am doing uname to figure out which OS, then set my commands as variables based on the OS because Solaris5.10 do not put everything in the same place as HP-UX 11, in fact running which mount on hp-ux gets an error. You have to know where it is and set a variable or call it explicitly everytime, which is not an option. So im not coding for a 15yo shell, im coding for all shells...hence this gets complicated.
5. On Solaris, GGREP is different than regular grep, hence a different variable is required.
You might be thinking...hmm why not just make a different script for each OS, that would be nice, if anyone at my company knew where these OS's were and what was running on them....but then again I guess that is why i still have a job
.