Created
August 13, 2012 14:28
-
-
Save joliss/3341227 to your computer and use it in GitHub Desktop.
Part of my generator script for .bashrc.generated, which is sourced from .bashrc. Allows running slow commands (lots of external calls, like `which`, etc.) without slowing shell startup.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
expand_source() { | |
perl -p -e 's/^source ["'\'']?(.*?)["'\'']?$/`cat $1`/em' | |
} | |
( | |
... | |
test -f "`which rbenv`" && rbenv init - --no-rehash | expand_source | |
) > ~/.bashrc.generated |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment