Originally Posted by anindyarc
I have bash shell, and I need to source a file from .bashrc file. but that file is a c shell file i.e it has commands like setenv etc. I need to change the whole file to a bash file. how can i do that? am new to linux. help me.
How long/complex is your file?
If it's just a handful of setenv statements conversion
is trivial, all you need to do is to replace a
setenv XXXX blahblah
One could just about do that with sed ;}
echo "setenv XXXX This is XXXX' contents" | sed -r 's/^[[:space:]]*setenv ([[:alnum:]]+) (.*)/export \1="\2"/'
export XXXX="This is XXXX' contents"