LWN.net Logo

Advertisement

E-Commerce & credit card processing - the Open Source way!

Advertise here

Incompatibility

Posted May 19, 2005 14:59 UTC (Thu) by modernjazz (subscriber, #4185)
In reply to: Incompatibility by liljencrantz
Parent article: Fish - The friendly interactive shell

I'm _not_ an expert, far from it. But how much of the end result of
initialization comes down to 2 things: setting environment variables and
aliases? If that's most of it, would it be possible to have fish: launch
a (say, bash) sub-shell for initialization, do the initialization in that
sub-shell, and then have fish simply parse the output of "env" and
"alias" commands running in that sub-shell?


(Log in to post comments)

Incompatibility

Posted May 19, 2005 15:35 UTC (Thu) by liljencrantz (subscriber, #28458) [Link]

Good question. This is more or less what Red Hat already does on some files for tcsh, at least under Fedora Core 3. They have a bunch of shell scripts only containing lines like:

FOO=BAR
BAZ=QUX
...

that are directly sourced by the init file under Bourne shells, and for tcsh, they run this monster:

eval `grep -v '^[:blank:]*#' $file | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|'`

Doing the same thing with aliases as well shouldn't be impossible. But it sure is ugly...

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds
Powered by Rackspace Managed Hosting.