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 need to start new Cygwin window with running alias in it. Opening new window is:

cygstart /bin/bash -li 

(Thanks to: Spawn New Cygwin Window from Within Cygwin)

But how can I send alias in that new Cygwin window? (alias compile="./ant compile")

cygstart /bin/bash -li ./ant compile

Current statement open new bash window and run command there, but not in new cygwin window.

Thanks!

share|improve this question
add comment

2 Answers 2

Use the -c switch to pass commands for bash to run, like so:

cygstart /bin/bash -li -c ./ant compile
share|improve this answer
add comment

I know is old but the answer is:

cygstart --directory=${pwd} /bin/bash -li -c \"./ant compile\"

The escaped quotations mark are needed to pass the command to bash.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.