You are not logged in.

#1 2022-11-16 01:37:06

Matesito
Member
Registered: 2022-11-15
Posts: 4

[SOLVED] Can't run programs that are in my path

Hope not to be duplicating the post... didn't find it...
Today something broke and can't run programs in ~/.local/bin from outside its directory.
Only thing I was doing was installing Emacs, Doom Emacs and packages from MELPA. 

[matt@arch ~]$ pyradio
-bash: pyradio: command not found
[matt@arch ~]$ [b]echo $PATH[/b]
”/home/matt/.emacs.d/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:[b]/home/matt/.local/bin[/b]”
[matt@arch ~]$ which pyradio
[b]which: no pyradio in [/b](”/home/matt/.emacs.d/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:[b]/home/matt/.local/bin[/b]”)
[matt@arch ~]$ export PATH="$PATH:[b]/home/matt/.local/bin[/b]"
[matt@arch ~]$ [b]pyradio[/b]

NOW IT WORKS

I have to manually export path for my programs and scripts in ~/.local/bin to work.

# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

export PATH="$PATH:/home/matt/.local/bin"
export PATH=”$HOME/.emacs.d/bin:$PATH”

export EDITOR='vim'
export VISUAL='vim'

source /usr/share/fzf/key-bindings.bash
source /usr/share/fzf/completion.bash



[ -f ~/.fzf.bash ] && source ~/.fzf.bash

Maybe because I'm lazy I'm tempted to timeshift to the last (very recent) backup,
but I'm very curious with what is wrong too.

Last edited by Matesito (2022-11-16 12:52:07)

Offline

#2 2022-11-16 01:59:08

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,178

Re: [SOLVED] Can't run programs that are in my path

Please edit your post to use [ code ] [ /code ] tags rather than quote tags.

If what you quoted is accurate, you either changed account or altered your prompt between the unsuccessful attempt and the successful one.

What is $PATH immediately before and after you export it?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2022-11-16 02:44:31

Matesito
Member
Registered: 2022-11-15
Posts: 4

Re: [SOLVED] Can't run programs that are in my path

cfr wrote:

If what you quoted is accurate....

It is accurate, I'm used to edit my home folder whenever I post in forums and I forgot to replace the last one (I hope it not to be a problem) and if it is sorry for that.

Not sure if it is what you are asking for but here you can see, pyradio is in ~/.local/bin, and the difference that I hadn't noticed before is that there are two ./loccal/bin paths, one outside the quotation marks, what does it mean?.

[matt@arch ~]$ ls ~/.local/bin
castero  mid3iconv  mutagen-inspect  pyradio  tqdm
cmark    mid3v2     mutagen-pony     pytube   unidecode
mid3cp   moggsplit  pygmentize       spotdl   yt-dlp
[matt@arch ~]$ echo $PATH
”/home/matt/.emacs.d/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/matt/.local/bin”
[matt@arch ~]$ export PATH="$PATH:/home/matt/.local/bin"
[matt@arch ~]$ echo $PATH
”/home/matt/.emacs.d/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/matt/.local/bin”:/home/matt/.local/bin
[matt@arch ~]$ 

(Home folder is edited again for coherence, it has been made with "search and replace all")

Offline

#4 2022-11-16 04:07:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [SOLVED] Can't run programs that are in my path

The problem is the quotes.  When it doesn't work it's because there's only one element in your path - and it's a ridiculously long and non-existent path.  You then add a second element to it which does exist, so then it works.

You need to get rid of the quotes.

EDIT: and the source of the problem is the non-standard quotation marks in the second export command of your shell rc.  I'd wager that comes from copy-and-pasting from some crappy website.  That line does not use hex code 22 quotes, but hex 201D quotation marks.

Last edited by Trilby (2022-11-16 04:10:55)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2022-11-16 12:41:09

Matesito
Member
Registered: 2022-11-15
Posts: 4

Re: [SOLVED] Can't run programs that are in my path

Trilby wrote:

...and the source of the problem is the non-standard quotation marks in the second export command of your shell rc.  I'd wager that comes from copy-and-pasting from some crappy website.  That line does not use hex code 22 quotes, but hex 201D quotation marks.

Thank you, you are wright. I promise never to cut and paste anymore! wink

Last edited by Matesito (2022-11-16 12:52:31)

Offline

#6 2022-11-16 12:57:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,480
Website

Re: [SOLVED] Can't run programs that are in my path

Or just actualy read command output as that's where I first saw the problem: echo $PATH should not show quotes of any sort.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB