Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I noticed that when I started a Terminal window by accident and tried to close it quickly by pressing the X on the window, I got a dialog box like this:

"Closing this window will terminate the running processes: login, bash, bash, perl."

My computer was under heavy load at the time and slow. I hit cancel, and tried it again, it closed quietly.

This leads me to believe that there is a Perl script loading every-time I start up my terminal. I have been unable to re-create the issue so far. How I can check exactly what scripts are being run when I open the Terminal?

1 /etc/profile

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
fi

2 ~/.profile
(just user defined aliases)

3 ~/.bash_profile

    # Setting PATH for MacPython 2.5
    # The orginal version is saved in .bash_profile.pysave
    PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
    export PATH

    test -r /sw/bin/init.sh && . /sw/bin/init.sh

    ##
    # Your previous /Users/USERNAME/.bash_profile file was backed up as /Users/USERNAME/.bash_profile.macports-saved_2010-04-04_at_17:07:45
    ##

    # MacPorts Installer addition on 2010-04-04_at_17:07:45: adding an appropriate PATH variable for use with MacPorts.
    export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    # Finished adapting your PATH environment variable for use with MacPorts.


    # MacPorts Installer addition on 2010-04-04_at_17:07:45: adding an appropriate MANPATH variable for use with MacPorts.
    export MANPATH=/opt/local/share/man:$MANPATH
    # Finished adapting your MANPATH environment variable for use with MacPorts.

#Add Some Color to "ls"
    export CLICOLOR=1
    export LSCOLORS=ExFxCxDxBxegedabagacad

    ##
    # Your previous /Users/USERNAME/.bash_profile file was backed up as /Users/USERNAME/.bash_profile.macports-saved_2011-09-23_at_23:15:01
    ##

    # MacPorts Installer addition on 2011-09-23_at_23:15:01: adding an appropriate PATH variable for use with MacPorts.
    export PATH=/opt/local/bin:/opt/local/sbin:$PATH
    # Finished adapting your PATH environment variable for use with MacPorts.

    # My Aliases
    (REMOVED ALIASES)

    4 ~/.bashrc
(FILE DOESN'T EXIST)
share|improve this question
    
It just seems suspicious that a perl script would be running on every terminal startup –  TheRealKingK Jun 9 '12 at 18:58
1  
Not really. If it's part of the configuration scripts, it will be run for every shell. How it got there in the first place is a question we can answer once we know what it is. Maybe you can add a screenshot of the terminal window the next time the issue occurs? –  patrix Jun 9 '12 at 19:01

2 Answers 2

up vote 3 down vote accepted

At startup bash executes (in that order)

  1. /etc/profile
  2. ~/.profile
  3. ~/.bash_profile
  4. ~/.bashrc

So any unexpected code should be called from one of these scripts (or a script called from one of them etc.).

share|improve this answer
    
alright, it seems that /etc/profile was calling eval, which i assume was interpreted by perl. –  TheRealKingK Jun 9 '12 at 19:07
    
Actually eval seems to be part of bash. So again the question of where this perl script is coming from. –  TheRealKingK Jun 9 '12 at 19:08
    
Please post a screen shot or look at the files mentioned line by line. –  patrix Jun 9 '12 at 20:45
    
I've added the requested files in the original post –  TheRealKingK Jun 12 '12 at 18:30
    
What's in /sw/bin/init.sh and in /etc/bashrc? And a screenshot would help as well –  patrix Jun 12 '12 at 18:48

Perl is running because you have Fink installed.

In ~/.bash_profile you have:

test -r /sw/bin/init.sh && . /sw/bin/init.sh

and in /sw/bin/init.sh you have:

perlversion=`/usr/bin/perl -e 'printf("%vd\n", $^V)'`

or something similar.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.