I am new to writing shell scripts and I am trying to write a script to CD to a folder where my programs are saved for one of my classes, then have a second terminal open that ssh's to a server used for testing the programs that I write. The problem is that I can not find a way to change the directory of the terminal shell to be where my programs are stored.
#!/bin/bash/ gnome-terminal -e "ssh firstname.lastname@example.org"; cd /path/to/dir
the problem is that the working directory does not change after the script terminates (it stays as it was when the script was called). I tried calling it except with a '.' in front of the name of the script to get it to run in the current process but the second terminal never opened.
I tried to do the same thing as above except I replaced the third line with
gnome-terminal -e "cd /path/to/dir/";
so that way two terminals would open, but the terminal ment to CD to the path gave an error along the lines of "there was an error creating the child process for this terminal: failed to execute child process 'cd'"
can anyone help me figure out how to solve this problem?