Reputation: 13
Say i need to run a couple of commands automatically in a shell everytime i open the shell. how can i automate that?
For Example:
I need to automate the following:
Upvotes: 0
Views: 97
Reputation: 15853
It depends what OS and Terminal you're using. I imagine most of the popular terminal allows you to customise the startup command. For example, in the Terminal.app that comes with Mac OS X, you can go to Preferences > Settings > Shell > Startup / run command to specify a script to run on startup of each terminal window/tab.
Or you can simply at the commands at $HOME/.profile
or $HOME/.bashrc
, depending on your OS and shell.
Upvotes: 1