Though not perfect, this actually helps quite a bit with the initialization files: http://www.opensource.apple.com/darwinsource/10.3/bash-29/bash/examples/misc/cshtobash It seems to do a good job on tcsh aliases that need to be converted to bash functions. I will eventually want to convert many of my simple tcsh scripts to bash because I want to write everything in bash, so when I modify a script, I'll want to convert it to bash and then work on it. For my simple scripts, this is usually pretty easy because there aren't too many shell-specific commands. In fact, it looks like the perl script below, that I just wrote, does a good job on *my* tcsh scripts which tend to use foreach loops quite a bit and nothing else fancy. Of course, it is not a complete general-purpose conversion script and it will not do everything that people might need done. For some of my tcsh scripts though, it converts them to bash, and they run correctly without further editing. It should work for both csh and tcsh scripts (but, again, there is a lot that it won't do). Have any of you done this kind of thing before? Let me know if you know of code for converting scripts or have ideas on how to make the thing below do more or work better. Best, Mike -------------begin perl script on next line--------------------- #!/usr/bin/perl -p # changes shebang line to bash path s@^#\! */.*csh.*$@#!/usr/bin/bash@ ; \ # translates "foreach foo" to "for foo in" and uses "$()" instead of "``" s/foreach (.+?) +\( *\140(.+?)\140 *\)/for $1 in \$($2) ; do/g ; \ # translates "foreach foo" to "for foo in" when backtick isn't used s/foreach (.+?) +\( *(.+?) *\)/for $1 in $2 ; do/g ; \ # uses "$()" instead of "``" s/\140(.+?)\140/\$($1)/g ; \ # changes "set" to "export" s/\bset(\s)/export$1/ ; \ # changes "end" to "done" for ending "for(each) loops" s/\bend(\s)/done$1/ -------------end perl script on previous line---------------------