I have a folder Parent folder which contains a script mytestcase.sh
parent_folder/mytestcase.shI am in Home directory .How can I start a new terminal using GNOME TERMINAL command, CD to parent_folder and issue the above script. The output of a new terminal should CD to Parent_folder and later issue the mytestcase.sh.
01 Answer
You can run the following:
gnome-terminal --window --working-directory /full/path/to/parent_folder -- ./mytestcase.shIf you want to keep the terminal open after execution of mytestcase.sh ends:
Method 1. Modify your mytestcase.sh script to add at the end a command like:
read DUMMYThis will wait until you press ENTER and then the terminal window will close.
Method 2. Use a custom profile in GNOME Terminal. In Preferences, define a new profile (let's call it noclose) and in the "Command" tab, choose the option to keep the window open after the command finishes. Then call gnome-terminal with the following command:
gnome-terminal --window-with-profile=noclose --working-directory /full/path/to/parent_folder -- ./mytestcase.sh 2