First off, I only just started learning how to use Linux yesterday so my abilities are very limited.I am essentially creating a script that I can run everytime I turn on my VPS and the script then turns on all the servers. However due to my lack of knowledge I have ran into some difficulties as once the script gets to turning the servers on it doesn't change the directories, leaving it as the default directory.I am not sure if I am doing it right at all, so if you find a mistake in the script it would be great if you could correct me - or if you have a more efficient way of doing something.#!/bin/bashservice mysqld startsudo service httpd restartsudo service vsftpd restartecho finished initializationcd ~/server_1 & dos2unix start.sh & sh start.sh & cd ~/server_2 & dos2unix start.sh & sh start.sh & cd ~/bungee_1 & dos2unix start.sh & sh start.sh && fgecho finished
Bash script not working, doesn't change directory
bash;shell script;cd command