1

I'm on Mac OS X High Sierra. I was doing an scp command, repeated several times so I wanted to be clever and just set the variable $IMAGE for the image name and $PATH if I needed to add an extra path to it. Well, I set the $PATH variable to "page-attachments" so naturally no linux commands will work in the CLI now. I can't even try to redefine $PATH. Any command returns

-bash: page-attachments: command not found

Is there a way for me to reset it to whatever it was? I can't vim .bashrc or .bash_profile because even vim doesn't work now. I'm not sure if it was /usr/bin or /usr/local/bin or something else or what other repercussions there are.

Christia
  • 215
  • 3
  • 13

1 Answers1

5

You could use something along the lines of:

PATH=$(/usr/bin/getconf PATH)

to use the full path to getconf, which will return a stock PATH value that you can use going forward.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250