В ходе попытки установить что-то на моей машине MAC OSX, я думаю, что повредил свой ~/.bash_profile файл. Я отредактировал его, и внезапно, теперь, когда я открываю терминал, я ничего не могу выполнить или даже перечислить файлы:
$ ls
-bash: ls: command not found
О нет! Я пытаюсь открыть emacs для редактирования ~/.bash_profile, но я не могу:
$ emacs ~/.bash_profile
-bash: emacs: command not found
$ port install emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Computing dependencies for emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Fetching emacs
---> Attempting to fetch emacs-23.2.tar.gz from http://www.mirrorservice.org/sites/ftp.gnu.org/gnu/emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Verifying checksum(s) for emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Extracting emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Configuring emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Building emacs
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Staging emacs into destroot
MacPorts running without privileges. You may be unable to complete certain actions (eg install).
---> Installing emacs @23.2_1
Error: Target org.macports.install returned: MacPorts requires root privileges for this action
Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.
Я не могу sudo, и я не могу изменить Средство поиска для показа скрытых файлов для открытия его оттуда также:
$ sudo port install emacs
-bash: sudo: command not found
$ defaults write com.apple.Finder AppleShowAllFiles YES
-bash: defaults: command not found
На помощь! Как я могу открыть ~/.bash_profile для фиксации его?
Используйте полные пути для команд, пока Вы не зафиксируете Ваш PATH
:
/bin/ls
/path/to/emacs
и т.д.
Вы, вероятно, повредили свою переменную окружения PATH...
Используйте средство поиска для открытия файла в textwrangler или около этого.