I have a nice little bash alias in my .bashrc folder that allows me to start Tomcat running without having to cd into the folder first, e.g.
alias startTomcat="cd ~/apache-tomcat-7.0.34/bin/ && ./startup.sh"
However when I run startTomcat
in a terminal, I'm booted out of the folder I started in, and now my terminal's residing in ~/apache-tomcat-7.0.34/bin/
. This is expected behaviour, of course, but what I'd like to do is run the command without winding up in a different folder.
Can I either save the original location, then return to it in my .bashrc file, or alternatively run startup.sh without cd
ing out of the original folder?
Thanks!!