How to remove entry from $PATH on mac

bash, macos, path-variables, terminal

Solution

What you're doing is valid for the current session (limited to the terminal that you're working in). You need to persist those changes. Consider adding commands in steps 1-3 above to your `${HOME}/.bashrc`.

Problem

I was trying to install Sencha Touch SDK tools 2.0.0 but could not run it properly. It created an entry in the $PATH variable. Later I deleted the sencha sdk tools folder but didn't realize that the path variable is still there. When i did `echo $PATH` I got - `/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin` I searched on how to remove variables from $PATH and followed these steps : - Gave the command `PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin"` - Did `echo $PATH` which showed `/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin` - gave the command `export PATH` - Closed terminal and reopened it. Gave the command `echo $PATH`. This time I got `/Applications/SenchaSDKTools-2.0.0-beta3:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin` Can anyone tell me what am i doing wrong?

Original source