[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BASH_FUNC__ appearing in environment
From: |
steveT |
Subject: |
Re: BASH_FUNC__ appearing in environment |
Date: |
Fri, 28 Nov 2014 00:00:17 -0800 (PST) |
User-agent: |
G2/1.0 |
On Thursday, 27 November 2014 17:57:30 UTC, konsolebox wrote:
> On Fri, Nov 28, 2014 at 12:36 AM, steveT steveT wrote:
> > Is there any way that I can trace them back to their 'creator'?
>
> Besides checking common startup files like /etc/profile and ~/.profile or
> ~/.bashrc (see
> http://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html),
> you can also try to debug bash as it loads in login mode:
>
> # bash -lx &> out.txt
> # exit
>
> Read out.txt, try to find those declarations and pay close attention to
> lines before it that calls another file with . or source. If you don't
> find any kind of declaration, it's likely that those functions are declared
> somewhere during system init and that would depend on your init system.
>
> If it's me I'd just do fgrep something /etc -r (not -R unless I'm sure it's
> safe) and see if I can find something useful. It may still not be enough
> though - especially if those declarations are hard-coded in a binary
> executable or data file. You can also consider searching through the files
> of the base package of your init system - or even examine the sources if
> you can.
>
> Cheers,
> konsolebox
Konsolebox,
Thanks - I did try recursively grepping etc and didn't find anything.
I will try the bash 'init' check, but I don't think it can be there as wouldn't
that imply that the BASH_FUNC__ vars would be there from the outset? And, the
BASH_FUNCs appear at random (obviously not random, as they must be being
triggered by something) points during the day - I can go hours and not see
these appear - I can use sudo and rcs to do various things and they don't
appear.
Can I ask - is there a chance that it's something that I've done in a script?
Is there a setting somewhere that tells bash to export certain functions to the
shell or do you have to explicitly export them to see them in the environment
like this?