Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small script, myscript.sh, that I want to run every time I start Cygwin - right now it just echoes "hello" but I want it to have useful functionality later.

Another post said to modify my .bash_profile file which I did, appending "source myscript.sh", but it didn't do anything.

Is there a way to do this? Running latest Cygwin from Win7.

share|improve this question

migrated from stackoverflow.com May 31 '13 at 6:23

This question came from our site for professional and enthusiast programmers.

1  
You could try appending that line to .bashrc, because it is possible that .bash_profile isn't actually being run. – Alex Gittemeier May 31 '13 at 3:25

I put things like this in my .bashrc file.

It's more common to execute scripts like this (rather than using the source command):

/path/to/script/script.sh

More specifically it might look like this:

/home/jahroy/bin/init-script.sh

The file has to be executable and should begin with something like this:

#!/bin/bash

You can substitute bash with your shell of choice.

share|improve this answer

You must log in to answer this question.