10

My .bashrc looks like this:

alias name@server="ssh server sname"
echo "bashrc read"

The echo statement is just for checking if it is read. But the echo does nothing. I want to set an alias for a quicker ssh into a box doing a certain command which is a working alias on the remote box.

boutta
  • 231
  • 1
  • 3
  • 8

4 Answers4

20

I haven't used cygwin in some time, but I'm guessing that it wants ~/.bash_profile. Simple fix to test.

ln -s ~/.bashrc ~/.bash_profile

Or if ~/.bash_profile exists, source .bashrc.

if [ -f ~/.bashrc ]
then
  . ~/.bashrc
fi
jtimberman
  • 7,511
  • 2
  • 33
  • 42
3

Because your cygwin bash is a login shell which reads the profile files, not the rc files. See jtimberman's answer for the second part of the answer... .

Vincent De Baere
  • 1,783
  • 9
  • 9
1

as jtimberman said, it's probably using .bash_profile. Another one to remember about is .profile.

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246
0

You need to resolve the ip. simply add the "ipaddress sname" to your C:\WINDOWS\system32\drivers\etc\hosts files and it should resolved it.

example: 127.0.0.1 localhost [ipaddress sname]

  • ohh you might need to type in "source .bashrc" to get it to reload the alias... :) –  Oct 30 '09 at 17:26