Terminal PATH startup message

bashpathterminal

I messed up when installing Cisco Packet Tracer for Linux and it some how changed a few bash files. After a few hours of looking around and changing my PATH, when I open a new Terminal window I get a message of every PATH that I've had (I think).

Last login: Wed Apr 10 14:38:52 on ttys000
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin"; export PATH;

I have tried to reset my PATH without any luck. The same message appears. It is as if it executes it at every new session.

Which file am I suppose to change to make it work?
EDIT:
when I run as suggested: grep PATH ~/.bash_profile ~/.bash_login

I get:
enter image description here

Best Answer

Method #1, inspection of files

Depending on how the software installed it likely would've one or more of these files:

  • /etc/profile
  • /etc/bashrc
  • ~/.bash_profile

Given it's a Linux scripted installer running on macOS it will likely have created some additional files which are typically not present on macOS but can augment the behavior of Bash when they're encountered.

  • ~/.bashrc
  • /etc/profile.d/*

I'd take care to go through all these locations' files and inspect them for any residual cruft from the Linux installer.

Method #2, searching

Since you have some hints from that $PATH output you could search for files that contain bits from that string. For example:

$ grep -r '/Applications/Xamarin Workbooks.app' /etc ~

And then make note of any files that are returned. These would be the files that require repair.