Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.