1

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.

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

1 Answer 1

0

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.

You must log in to answer this question.