I have created one myscript.sh file as following
#!/bin/bash
source ~/.profile
cd $GOPATH/src
revel run test/streetcom
I need to run this file at startup after login.
I tried using startup application by creating a new field with command as the path of myscript.sh which is:
/home/pi/myscript.sh
but it did not work. I want to run the above script on the terminal after login on startup. Is there any way to run this script on tmux session. I tried adding following line after #!/bin/ bash in myscript.sh file.
tmux new -s piwork
Tmux session piwork got created but the remaining commands getting executed in another terminal window.
if you want to run the script at startup, do the following :
- Run
sudo chmod +x /home/pi/myscript.sh
to make your script executable. - Open .bashrc file using
sudo gedit ~/.bashrc
orsudo nano ~/.bashrc
- Place the command that runs the script (
./home/pi/myscript.sh
) in the end of the file. - Save and exit.
It should run on the next startup.
No comments:
Post a Comment