How can I convert c shell to bash shell

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
ss88
Level 1
Level 1
Posts: 1
Joined: Fri Nov 20, 2009 5:41 am

How can I convert c shell to bash shell

Postby ss88 » Fri Nov 20, 2009 5:46 am

I have a file that work on c shell (csh). But it's not work because I use bash shell in my Linux

How can I convert this?

setenv DOVIS /export/home/arditya/dovis/

setenv MGL_ROOT "$DOVIS/MGLTools"
setenv MGL_ARCHOSV "$MGL_ROOT/i86Linux2"

unset PYTHONHOME
setenv PYTHONHOME "$MGL_ROOT/share:$MGL_ARCHOSV"
setenv PYTHONPATH "$MGL_ROOT/MGLToolsPckgs"

set path = ( $DOVIS/bin $DOVIS/scripts \
$MGL_ROOT/i86Linux2/bin \
$MGL_ROOT/MGLToolsPckgs/AutoDockTools/Utilities24 \
$path)

User avatar
garda
Level 5
Level 5
Posts: 744
Joined: Sat Aug 30, 2008 2:55 am
Location: /root

Re: How can I convert c shell to bash shell

Postby garda » Fri Nov 20, 2009 6:39 am

Put them in a script and add #!/bin/csh -f in the header. Like so:

Code: Select all

#!/bin/csh -f

setenv DOVIS /export/home/arditya/dovis/

setenv MGL_ROOT "$DOVIS/MGLTools"
setenv MGL_ARCHOSV "$MGL_ROOT/i86Linux2"

unset PYTHONHOME
setenv PYTHONHOME "$MGL_ROOT/share:$MGL_ARCHOSV"
setenv PYTHONPATH "$MGL_ROOT/MGLToolsPckgs"

set path = ( $DOVIS/bin $DOVIS/scripts \
$MGL_ROOT/i86Linux2/bin \
$MGL_ROOT/MGLToolsPckgs/AutoDockTools/Utilities24 \
$path)

Make sure CSH is already installed, otherwise it won't work.
Image


Return to “Newbie Questions”

Who is online

Users browsing this forum: No registered users and 10 guests