You are not logged in.
When I am at the console of my custom ISO zsh can find my scripts in /usr/loca/bin using tab completion. However when I am at a console in my booted system bash is not able to find my scripts in /usr/loca/bin using tab completion. This has not been in issue since I am in the habit of using full paths when testing my scripts.
However today I decided to peak at /etc/profile to see how PATH is being set. I found 'export PATH' instead of 'export $PATH' in there. When I changed PATH to $PATH tab completion started working.
I am no guru so I have to wonder if there is a reason for having PATH instead of $PATH?
Last edited by lenhuppe (2022-11-26 19:14:08)
"I'm suspicious of people who don't like dogs, but I trust a dog when it doesn't like a person." -- Bill Murray
Offline
You are exporting the variable, not the content of the variable
export $PATH
will export the contents and not the variable and will most likely fail due to being an illegal construct.
You used /usr/loca/bin without the l twice. Are you actually setting the $PATH variable yourself somehow in a way that would have a problem were it already set? What's your actual output of
echo $PATH
for you?
Last edited by V1del (2022-11-18 00:32:53)
Offline
You are exporting the variable, not the content of the variable
export $PATH
will export the contents and not the variable and will most likely fail due to being an illegal construct.
You used /usr/loca/bin without the l twice. Are you actually setting the $PATH variable yourself somehow in a way that would have a problem were it already set? What's your actual output of
echo $PATH
for you?
I meant /usr/local/bin ... that was a typo
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
Last edited by lenhuppe (2022-11-18 01:22:32)
"I'm suspicious of people who don't like dogs, but I trust a dog when it doesn't like a person." -- Bill Murray
Offline
When I changed PATH to $PATH tab completion started working.
https://www.merriam-webster.com/dictionary/coincidence
As V1del pointed out "export $PATH" will just cause an error and you should undo that.
In what context did you "echo $PATH"?
bash? zsh?
What likely happens is that you extend the $PATH to include /usr/local/bin in a file that'S only sourced by zsh - then, while testing, you either explicitly sourced that file or moved from a zsh to a bash, carrying over the exported $PATH
zsh
export FOO=BAR
bash
echo $FOO
Whatever the scenario is: "export $PATH" did *NOT* fix anything for you for sure.
Edit: afacis the default /etc/profile already adds /usr/local/bin to the PATH - what does your copy look like?
Last edited by seth (2022-11-18 08:13:28)
Offline
In what context did you "echo $PATH"?
bash? zsh?
A bash console and also a terminal app ... the results were the same.
The difference in behavior between zsh and bash was caused by having fzf completion enabled in bash.
When I disabled fzf completion in bash it did a full path search and found my custom script files.
Last edited by lenhuppe (2022-11-18 19:41:52)
"I'm suspicious of people who don't like dogs, but I trust a dog when it doesn't like a person." -- Bill Murray
Offline
Solution:
When enabling fzf in bash the sequence is important
source /usr/share/fzf/key-bindings.bash
source /usr/share/fzf/completion.bash
source /usr/share/fzf/<custom>.bash
Also when using sudo on my scripts I have to fill in the full path with tab completion.
"I'm suspicious of people who don't like dogs, but I trust a dog when it doesn't like a person." -- Bill Murray
Offline