Broken $PATH variable

Solution 1:

Just use the full path to open:

/usr/bin/open .profile

Once you've fixed your path, your shell will be functional again.