Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:45:24+00:00 2026-05-30T08:45:24+00:00

I need to run a certain command when a push is received in a

  • 0

I need to run a certain command when a push is received in a repository. That binary is located at a custom path which I added to .bashrc and works normally from the shell. I wrote a little script as a git hook. However, the .bashrc additions don’t seem to affect this script.

I’ve tried putting bash ~/.bashrc at the top of the script but didn’t work. If I run the script manually, say $ sh post-receive, it works just fine. What is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:45:26+00:00Added an answer on May 30, 2026 at 8:45 am

    The script is probably run as a different user, or is being invoked with options to disable interactive features and/or startup scripts. That’s as it should be; nothing is “wrong” here really.

    You can add . /home/you/.bashrc as a quick and dirty workaround; or, more properly, just amend the script’s PATH directly; or, even more properly, modularize dependencies e.g. by putting the code in a separate file which you source both from your .bashrc and from this script – but for this isolated case, that´s certainly overkill.

    The command to “include” a file of shell scipt is called “source” or “dot”; in Bash, source is available as a synonym, but in proper Bourne shell, it’s a literal dot (aka period, full stop):

    . /path/to/stuff
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to schedule a console application to run daily at a certain time
i need run code that will create a database and populate tables. i am
I need to run an equipment audit and to do that I need to
I need to run a Linux CLI command and get its stdout output from
I need to run a utility only if a certain file exists. How do
I need my Android application to run a certain Activity in my app, responding
I have an application that I need to automate where at a certain time
I need to run a command as part of my build workflow. Specifically, it
I need to prevent a certain application function from being run concurrently with itself.
I currently use a Windows 7 Home Basic. I need to run a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.