dirname script added, tested successfully on CLOUD

realpath on its own wasn’t working, however the addition of dirname
worked perfectly.