Sunday, 18 August 2013

Cygwin tcsh not able to recognize aliases when calling from VB.NET but works manually

Cygwin tcsh not able to recognize aliases when calling from VB.NET but
works manually

Yes. Ive gone through the other similar posts.None of them solves my
problem. My issue is something like this:
I have my Cygwin installed properly.I have $HOME set to some other
directory in my environment variable.Have placed an .cshrc file in
$HOME.The csh.chrc file in /etc has been updated. Now,when i launch tcsh
from my desktop shortcut, and type in any alias, it is working! Now, i
invoke tcsh and call a .csh script from my VB.NET program.The code looks
something like this in VB.NET: Shell("C:\cygwin\bin\mintty.exe --hold
always /bin/tcsh D:/test.csh") It invokes the shell correctly.Executes all
the commands in the script D:/test.cash EXCEPT for the aliases present in
it.When it comes to aliases, it says - Command not found. But after that,
if i manually execute the alias in the same window, it recognizes it.
Other Observations: 1. If i do env in the same window after script
execution, i can see all the custom environment variables set in
$HOME/.cshrc which means it is reading the ~/.cshrc file. 2.If i start
tcsh from desktop shortcut, it starts in $HOME directory, but if invoked
through VB.NET it starts in /usr/bin.
Whacking my brains from a couple of days to figure out where its going
wrong! Could anybody out here chip in with some help?
Thanks in advance!
Cheers!
What i tried: Adding source ~/.cshrc at the start of the script file didnt
help me.

No comments:

Post a Comment