[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

introducing BASHRC env var

From: Robinson, Mark
Subject: introducing BASHRC env var
Date: Tue, 21 Mar 2006 10:42:37 +1100


Attached is a little hack which allows you to define an alternative to 
~/.bashrc by setting the BASHRC environment variable.  

This was useful to me since I am unable to modify ~/.bashrc on a customer site 
to my taste without incurring the wrath of other folks using the same user 
login.  Yes, I now you can specify an alternate bashrc with the  --rcfile  
parameter, but then subsequent instances of bash invoked by screen, for 
instance, do not know about the alternate location of bashrc.


--- shell.c.save        2006-03-16 10:56:45.374615000 +1100
+++ shell.c     2006-03-16 10:56:50.342055000 +1100
@@ -423,6 +423,10 @@
   set_shell_name (argv[0]);
   shell_start_time = NOW;      /* NOW now defined in general.h */
+  /* ~/.bashrc might be somewhere else */
+  if (getenv ("BASHRC"))
+      bashrc_file = getenv ("BASHRC");
   /* Parse argument flags from the input line. */
   /* Find full word arguments first. */

reply via email to

[Prev in Thread] Current Thread [Next in Thread]