2017-01-04 42 views
-1

我試圖在我的Mac上安裝思科數據包跟蹤器。這是一個sh腳本來安裝它。我跑了它,但沒有蘇,它在我的Mac上做了一些混亂。 1分鐘後,我看到我的磁盤已滿,因爲腳本複製了各處的記錄。 現在,當我啓動我的終端,命令我最近安裝(NPM沖泡,科爾多瓦...)不再被認可,並沒有我的用戶名在該行的開頭,有嘗試安裝思科數據包跟蹤器後OSX終端損壞

-bash-3.2$ 

在每次啓動終端,我得到它上面這個錯誤:

Last login: Wed Jan 4 17:04:13 on ttys000 
-bash: /etc/profile: line 1: syntax error near unexpected token `(' 
-bash: /etc/profile: line 1: `-e \n# System-wide .profile for sh(1)\n\nif [ -x /usr/libexec/path_helper ]; then\neval `/usr/libexec/path_helper -s`\nfi\n\nif [ "${BASH-no}" != "no" ]; then\n[ -r /etc/bashrc ] && . /etc/bashrc\nfi\nPT7HOME=/Users/myusername/Documents/pt' 

我刪除了文件夾/用戶/名爲myUsername /文檔/磅,但似乎這是那裏的錯誤來了從。預先感謝您的幫助。

+1

使用Time Machine恢復更改。 –

+4

我建議你跟思科交談,並要求退款。認真地說,應該聯繫思科支持。 – cdarke

+0

另一方面,對'/ etc/profile'的唯一直接損害似乎是在文件頂部添加了'-e'(或者是一個文字字符串「-e \ n」)。刪除那個位,直到'#System-wide .profile',向更靠近一步被修復。 – chepner

回答

1

該錯誤消息意味着你的/etc/profile,默認情況下看起來像

# System-wide .profile for sh(1) 

if [ -x /usr/libexec/path_helper ]; then 
     eval `/usr/libexec/path_helper -s` 
fi 

if [ "${BASH-no}" != "no" ]; then 
     [ -r /etc/bashrc ] && . /etc/bashrc 
fi 

旨在進行修改,加入單行的底部

# System-wide .profile for sh(1) 

if [ -x /usr/libexec/path_helper ]; then 
     eval `/usr/libexec/path_helper -s` 
fi 

if [ "${BASH-no}" != "no" ]; then 
     [ -r /etc/bashrc ] && . /etc/bashrc 
fi 
PT7HOME=/Users/myusername/Documents/pt 

然而,東西去錯誤的,並且除了在文件的開頭添加一些額外的字符之外,縮進被移除並且換行符被轉換成文字\n序列,導致Ë內容成爲單行線,也許

-e \n# System-wide .profile for sh(1)\n\nif [ -x /usr/libexec/path_helper ]; then\neval `/usr/libexec/path_helper -s`\nfi\n\nif [ "${BASH-no}" != "no" ]; then\n[ -r /etc/bashrc ] && . /etc/bashrc\nfi\nPT7HOME=/Users/myusername/Documents/pt 

沒有進一步的信息,我建議你可以簡單編輯這個文件,看起來像修改後的版本上面。但是,應該採取@n.m.和@ cdarke的建議:如果可能,請從備份中恢復,並聯系用戶支持以找出腳本中可能出現的錯誤。

+0

謝謝你的答案。我finnaly做了一個乾淨的安裝我的mac,因爲我仍然有錯誤。 – saperlipopette