# Tcsh alternative?



## dinsdale (Aug 11, 2015)

`DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"`

A gmake file for MonoDevelop uses that command and it is failing. Can someone give me a csh/tcsh alternative? I'm not really sure what this is doing? stupid bash... 

This is a similar question on stackoverflow:

http://stackoverflow.com/questions/9901210/bash-source0-equivalent-in-zsh


p.s. bonus points if there is some way to make both co-exist so I can create a pull request. It's for the make file on MonoDevelop: https://github.com/mono/monodevelop

Thanks!
dinsdale


----------



## kpa (Aug 11, 2015)

Nothing really wrong with that construct except that whoever wrote that is assuming that /bin/sh is shells/bash. You don't really want to translate that to tcsh(1) because tcsh is quite lacking in scripting capabilities, it's a fine interactive shell though. Try what happens if you prefix the build command with `env SHELL=/usr/local/bin/bash` (with shells/bash installed of course).


----------

