Modify terminal script for linux as suggested by @benjaminpick