LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Typo while exporting path and now having issues (https://www.linuxquestions.org/questions/programming-9/typo-while-exporting-path-and-now-having-issues-4175657720/)

etho201 07-19-2019 07:32 PM

Typo while exporting path and now having issues
 
I am having an issue from a typo I made when exporting a path. I was setting up the Google Go programming language on my Fedora 30 machine, but I mis-typed something while exporting my path.

I was supposed to type:
Code:

export PATH=$PATH:/usr/local/go/bin
but instead I placed an @ symbol in front of PATH like this:
Code:

export PATH=@PATH:/usr/local/go/bin

Now when I try to run nearly any command in the terminal, I am presented with messages like:
Code:

[erik@erik-pc bin]$ vi ~/bashbash: grep: command not found
bash: grep: command not found

bash: vi: command not found...
Install package 'vim-minimal' to provide command 'vi'? [N/y] y


 * Waiting in queue...
 * Loading list of packages....
The following packages have to be updated:
 vim-minimal-2:8.1.1661-1.fc30.x86_64        A minimal version of the VIM editor
Proceed with changes? [N/y] N

The transaction did not proceed.
Failed to install packages: user declined simulation

bash: sed: command not found...
Install package 'sed' to provide command 'sed'? [N/y] y

Failed to install packages: sed-4.5-3.fc30.x86_64 is already installed

I can I restore my system and get my profile back into working order?

individual 07-19-2019 07:40 PM

Just type the absolute path to vi?
Code:

/usr/bin/vi .bashrc
EDIT: In case it wasn't clear, I'm saying use the absolute path to vi to edit your .bashrc and fix PATH.

scasey 07-19-2019 07:45 PM

Restore the .bashrc from backup?

etho201 07-19-2019 09:21 PM

Quote:

Originally Posted by individual (Post 6016835)
Just type the absolute path to vi?
Code:

/usr/bin/vi .bashrc
EDIT: In case it wasn't clear, I'm saying use the absolute path to vi to edit your .bashrc and fix PATH.

That was clear. Thank you! I'm looking at .bashrc and I don't see anything wrong with it.

Code:

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
    PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions


etho201 07-19-2019 09:22 PM

Quote:

Originally Posted by scasey (Post 6016836)
Restore the .bashrc from backup?

I don't believe I have my system configured to run any backups. Unless Fedora 30 comes stock with this...

etho201 07-19-2019 09:36 PM

I'm not sure what happened. After I restarted my terminal session the problem went away. I didn't do anything to before that.

scasey 07-19-2019 09:54 PM

Quote:

Originally Posted by etho201 (Post 6016848)
I'm not sure what happened. After I restarted my terminal session the problem went away. I didn't do anything to before that.

Ah. We (I, at least) presumed you were editing your .bashrc when you made the typo. If you did that at the command line then, yes, restarting your terminal would undo the change.
Code:

. .bashrc
would have also fixed it.

vi can be configured to always make a backup...making a copy of files before you edit them is a good practice.

Glad all is better!

etho201 07-20-2019 12:55 AM

Thanks Sean! I understand now. Since running the export command in an active session invokes those settings for that session only. I think configuring vi to automatically create a backup is a great idea. I'll look into doing that. Thanks for your help.


All times are GMT -5. The time now is 02:06 PM.