LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-19-2019, 07:32 PM   #1
etho201
LQ Newbie
 
Registered: Jul 2019
Posts: 5

Rep: Reputation: Disabled
Unhappy 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?

Last edited by etho201; 07-19-2019 at 07:34 PM.
 
Old 07-19-2019, 07:40 PM   #2
individual
Member
 
Registered: Jul 2018
Posts: 231

Rep: Reputation: 175Reputation: 175
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.

Last edited by individual; 07-19-2019 at 07:52 PM.
 
Old 07-19-2019, 07:45 PM   #3
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,458

Rep: Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160
Restore the .bashrc from backup?
 
Old 07-19-2019, 09:21 PM   #4
etho201
LQ Newbie
 
Registered: Jul 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by individual View Post
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
 
Old 07-19-2019, 09:22 PM   #5
etho201
LQ Newbie
 
Registered: Jul 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
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...
 
Old 07-19-2019, 09:36 PM   #6
etho201
LQ Newbie
 
Registered: Jul 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
I'm not sure what happened. After I restarted my terminal session the problem went away. I didn't do anything to before that.
 
Old 07-19-2019, 09:54 PM   #7
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.6
Posts: 3,458

Rep: Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160Reputation: 1160
Quote:
Originally Posted by etho201 View Post
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!
 
Old 07-20-2019, 12:55 AM   #8
etho201
LQ Newbie
 
Registered: Jul 2019
Posts: 5

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] slackware current, typo in new rc.inet1, also is gtk3 now required for firefox? pataphysician Slackware 23 05-24-2017 01:48 AM
typo in move command - files gone now? Eusaphious Linux - General 6 07-23-2008 04:50 AM
exporting PATH for a command arunsri Slackware 4 03-20-2005 05:47 PM
exporting PATH (without logging in again) rohr Debian 1 02-17-2005 10:56 AM
exporting one NFS folder to another NFS and exporting it.... stellarmarine1 Linux - Networking 3 09-20-2004 06:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration