How to automate a source command

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have to run a command every morning after I log on to the server to enable certain company specific functionalities.



The command looks like this:
source /data/dev/int/default/somethingsomething.env



Is there a way to automate this so I don't have to copy/paste it?










share|improve this question























  • What shell do you use?
    – Jeff Schaller
    Aug 15 at 0:46










  • zsh apparently, had no idea how to even check this till now
    – solarflare
    Aug 15 at 0:50










  • @Wildcard, I didn't see a zsh answer in there, so I went ahead and posted an Answer here.
    – Jeff Schaller
    Aug 15 at 1:00










  • The "duplicate" was about sourcing a tcsh script when opening a terminal (that starts a bash shell on CentOS), quite different here. The answers there certainly don't apply here.
    – Stéphane Chazelas
    Aug 16 at 13:13















up vote
0
down vote

favorite












I have to run a command every morning after I log on to the server to enable certain company specific functionalities.



The command looks like this:
source /data/dev/int/default/somethingsomething.env



Is there a way to automate this so I don't have to copy/paste it?










share|improve this question























  • What shell do you use?
    – Jeff Schaller
    Aug 15 at 0:46










  • zsh apparently, had no idea how to even check this till now
    – solarflare
    Aug 15 at 0:50










  • @Wildcard, I didn't see a zsh answer in there, so I went ahead and posted an Answer here.
    – Jeff Schaller
    Aug 15 at 1:00










  • The "duplicate" was about sourcing a tcsh script when opening a terminal (that starts a bash shell on CentOS), quite different here. The answers there certainly don't apply here.
    – Stéphane Chazelas
    Aug 16 at 13:13













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have to run a command every morning after I log on to the server to enable certain company specific functionalities.



The command looks like this:
source /data/dev/int/default/somethingsomething.env



Is there a way to automate this so I don't have to copy/paste it?










share|improve this question















I have to run a command every morning after I log on to the server to enable certain company specific functionalities.



The command looks like this:
source /data/dev/int/default/somethingsomething.env



Is there a way to automate this so I don't have to copy/paste it?







zsh environment-variables login source






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 15 at 1:00









Jeff Schaller

32.6k849110




32.6k849110










asked Aug 14 at 23:21









solarflare

1093




1093











  • What shell do you use?
    – Jeff Schaller
    Aug 15 at 0:46










  • zsh apparently, had no idea how to even check this till now
    – solarflare
    Aug 15 at 0:50










  • @Wildcard, I didn't see a zsh answer in there, so I went ahead and posted an Answer here.
    – Jeff Schaller
    Aug 15 at 1:00










  • The "duplicate" was about sourcing a tcsh script when opening a terminal (that starts a bash shell on CentOS), quite different here. The answers there certainly don't apply here.
    – Stéphane Chazelas
    Aug 16 at 13:13

















  • What shell do you use?
    – Jeff Schaller
    Aug 15 at 0:46










  • zsh apparently, had no idea how to even check this till now
    – solarflare
    Aug 15 at 0:50










  • @Wildcard, I didn't see a zsh answer in there, so I went ahead and posted an Answer here.
    – Jeff Schaller
    Aug 15 at 1:00










  • The "duplicate" was about sourcing a tcsh script when opening a terminal (that starts a bash shell on CentOS), quite different here. The answers there certainly don't apply here.
    – Stéphane Chazelas
    Aug 16 at 13:13
















What shell do you use?
– Jeff Schaller
Aug 15 at 0:46




What shell do you use?
– Jeff Schaller
Aug 15 at 0:46












zsh apparently, had no idea how to even check this till now
– solarflare
Aug 15 at 0:50




zsh apparently, had no idea how to even check this till now
– solarflare
Aug 15 at 0:50












@Wildcard, I didn't see a zsh answer in there, so I went ahead and posted an Answer here.
– Jeff Schaller
Aug 15 at 1:00




@Wildcard, I didn't see a zsh answer in there, so I went ahead and posted an Answer here.
– Jeff Schaller
Aug 15 at 1:00












The "duplicate" was about sourcing a tcsh script when opening a terminal (that starts a bash shell on CentOS), quite different here. The answers there certainly don't apply here.
– Stéphane Chazelas
Aug 16 at 13:13





The "duplicate" was about sourcing a tcsh script when opening a terminal (that starts a bash shell on CentOS), quite different here. The answers there certainly don't apply here.
– Stéphane Chazelas
Aug 16 at 13:13











1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Based on http://zsh.sourceforge.net/Doc/Release/Files.html#Files, I would recommend placing the command in your ~/.zshrc file.




Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc




Where ZDOTDIR can be set to override the default value of $HOME.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462634%2fhow-to-automate-a-source-command%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Based on http://zsh.sourceforge.net/Doc/Release/Files.html#Files, I would recommend placing the command in your ~/.zshrc file.




    Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc




    Where ZDOTDIR can be set to override the default value of $HOME.






    share|improve this answer
























      up vote
      1
      down vote



      accepted










      Based on http://zsh.sourceforge.net/Doc/Release/Files.html#Files, I would recommend placing the command in your ~/.zshrc file.




      Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc




      Where ZDOTDIR can be set to override the default value of $HOME.






      share|improve this answer






















        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Based on http://zsh.sourceforge.net/Doc/Release/Files.html#Files, I would recommend placing the command in your ~/.zshrc file.




        Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc




        Where ZDOTDIR can be set to override the default value of $HOME.






        share|improve this answer












        Based on http://zsh.sourceforge.net/Doc/Release/Files.html#Files, I would recommend placing the command in your ~/.zshrc file.




        Then, if the shell is interactive, commands are read from /etc/zshrc and then $ZDOTDIR/.zshrc




        Where ZDOTDIR can be set to override the default value of $HOME.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Aug 15 at 0:59









        Jeff Schaller

        32.6k849110




        32.6k849110



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f462634%2fhow-to-automate-a-source-command%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)