aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/init.csh12
-rw-r--r--init/init.sh12
2 files changed, 24 insertions, 0 deletions
diff --git a/init/init.csh b/init/init.csh
new file mode 100644
index 0000000..5c370c7
--- /dev/null
+++ b/init/init.csh
@@ -0,0 +1,12 @@
+# Set location of multihome to avoid PATH lookups
+setenv MULTIHOME "%s"
+if ( -x "$MULTIHOME" ) then
+ # Save HOME
+ setenv HOME_OLD "$HOME"
+ # Redeclare HOME
+ setenv HOME "`$MULTIHOME`"
+ # Switch to new HOME
+ if ( "$HOME" != "$HOME_OLD" ) then
+ cd "$HOME"
+ endif
+endif
diff --git a/init/init.sh b/init/init.sh
new file mode 100644
index 0000000..804d511
--- /dev/null
+++ b/init/init.sh
@@ -0,0 +1,12 @@
+# Set location of multihome to avoid PATH lookups
+MULTIHOME="%s"
+if [ -x "$MULTIHOME" ]; then
+ # Save HOME
+ HOME_OLD="$HOME"
+ # Redeclare HOME
+ HOME="$($MULTIHOME)"
+ # Switch to new HOME
+ if [ "$HOME" != "$HOME_OLD" ]; then
+ cd "$HOME"
+ fi
+fi