3

I'd like some commands to run a script at startup.

However, my default shell is zsh, so the traditional .bash files seems unwise. At the same time, I believe .zshrc is sourced at every shell invocation.

How can I run a command at startup when my default shell is zsh?

EDIT: To be clear, by "startup" I mean login.

2
  • I don't think your question is very clear. What are you trying to run at login. I do agree with the answer from "The Lord of Time" to not worry about it; but I am not positive since I am not clear what you are trying to run at login.
    – haziz
    Apr 7, 2013 at 23:26
  • @haziz, I'm trying to run a command after I login and X has been started. Its a custom shell script in my path. Apr 8, 2013 at 3:13

2 Answers 2

3

I don't believe you have to worry about this, if this is a before-GUI-loads script, or before-logins-are-accepted script that needs to run, as long as you define what it is in the beginning of the script file.

If this is going into rc.local then I don't believe you need to be concerned about Bash vs. ZSH. However, if this is going to load for each login shell, then you do partly need to be concerned about whether ZSH runs it or some other shell language runs it.

2
  • I'm looking for something that runs after login and GUI startup. How would I do that? Mar 13, 2013 at 12:42
  • @DavidY.Stephenson See user1251007's answer on this question :P
    – Thomas Ward
    Mar 13, 2013 at 18:05
1

You might try using Startup Applications.

Here is what you have to do, to automatically start the command unity-2d-shell on startup. unity-2d-shell is just an example, you can have your own .sh scripts. Just save your script somewhere and add under command (step 2 below).

  1. Open Startup Applications

    Open <code>Startup Applications</code>

  2. Add Startup Program Add Startup Program

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .