[arch-general] not able to execute commands on tty
Hi, I'm having an issue with tty. When loogin on I get the following error messages: -bash: /etc/profile: Permission denied -bash: PATH: Command not found ... This is my bashrc: # # ~/.bashrc # # If not running interactively, don't do anything [[ $- != *i* ]] && return #fix VTE issue for tilix if [ $TILIX_ID ] || [ $VTE_VERSION ]; then source /etc/profile.d/vte.sh fi alias ls='ls --color=auto' alias ll='ls -l' alias la='ls -a' alias diff='diff --color=auto' alias grep='grep --color=auto' alias mpv='mpv --vo=gpu' #command not found #source /usr/share/doc/find-the-command/ftc.bash powerline-daemon -q POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 . /usr/share/powerline/bindings/bash/powerline.sh and here's my .profile: #set vim as default editor export EDITOR=vim #prevent logging identical commands and commands starting with a space export HISTCONTROL=ignoreboth #append to history on exit shopt -s histappend #store multiline commands in one entry shopt -s cmdhist #line wrap on windowresize shopt -s checkwinsize ##tell apps to use Wayland #Firefox export MOZ_ENABLE_WAYLAND=1 #prevent accessibility tools export NO_AT_BRIDGE=1 #add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/" [[ -f ~/.bashrc ]] && . ~/.bashrc I'm not able to execute any commands, getting the command not found, and have no idea what wnet wrong here. All is fine when on wayland using a treminal emulator. THX Frank
On 25/04/2022 16:57, Frank via arch-general wrote:
export PATH="$(PATH)
Including the value in parentheses is attempting to run the value of $PATH as a command; that in turn is failing, and likely setting PATH to an empty value, breaking $PATH for subsequent calls.
On Mon, Apr 25, 2022 at 4:56 PM Frank via arch-general < arch-general@lists.archlinux.org> wrote:
Hi,
I'm having an issue with tty. When loogin on I get the following error messages: -bash: /etc/profile: Permission denied -bash: PATH: Command not found ...
This is my bashrc:
# # ~/.bashrc #
# If not running interactively, don't do anything [[ $- != *i* ]] && return
snip
#add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/"
This looks wrong. This would presumably try to change the path three times and only store the last one - but even that looks wrong.
PATH=$PATH:/usr/bin/core_perl:/usr/bin/vendor_perl:/usr/bin/site_perl export PATH would likely work as intended though. I didn't look to see if there were other problems with the other section of the file - but this part should be fixed and then try again. -- mike c
On 2022-04-25 at 17:32:50 +0100, Mike Cloaked via arch-general <arch-general@lists.archlinux.org> wrote:
On Mon, Apr 25, 2022 at 4:56 PM Frank via arch-general < arch-general@lists.archlinux.org> wrote:
#add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/"
This looks wrong. This would presumably try to change the path three times and only store the last one - but even that looks wrong.
That's the right construct, but as someone else pointed out, the parentheses should be braces. The idea is that for desired each element in PATH, there's exactly one line of code. It's easy to copy/paste a new one or delete an old one, and it makes for clean/cleaner diffs.
PATH=$PATH:/usr/bin/core_perl:/usr/bin/vendor_perl:/usr/bin/site_perl
If I do that, and decide that I don't want vendor_perl anymore, then I have to edit (carefully!) the middle of that line, and that (the standard line-oriented) diff will show me only a monolithic before/after picture. In the OP's scheme, I can delete one complete line, and diff will show very clearly what I deleted. (I'm not claiming that your scheme is unworkable, or that text editors or other tools are incapable of assisting. I am claiming that the OP's scheme has its advantages and is definitely not wrong, modulo the curly braces.)
Am Montag, dem 25.04.2022 um 11:45 -0500 schrieb Dan Sommers via arch- general:
On 2022-04-25 at 17:32:50 +0100, Mike Cloaked via arch-general <arch-general@lists.archlinux.org> wrote:
On Mon, Apr 25, 2022 at 4:56 PM Frank via arch-general < arch-general@lists.archlinux.org> wrote:
#add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/"
That's the right construct, but as someone else pointed out, the parentheses should be braces.
OK, this is getting rid of the error PATH command not found and I just realised that /etc/profile/perbin.sh is nowadays taking care of this. However, I still have the issue that I cannot execute any command. Is this to do with the following mesasge ? -bash: /etc/profile: Permission denied I thought permissions look ok -rw-r--r-- 1 root root 1169 5. Apr 08:57 /etc/profile Frank
On Mon, Apr 25, 2022 at 20:43:05 +0200, Frank via arch-general wrote:
However, I still have the issue that I cannot execute any command. Is this to do with the following mesasge ? -bash: /etc/profile: Permission denied
This looks more like it's trying to execute /etc/profile rather than source it. But I don't see anything in your ~/.bashrc or ~/.profile that would cause that (unless any of the sourced files would do that, i.e. /etc/profile.d/vte.sh and /usr/share/powerline/bindings/bash/powerline.sh). Regards, Tinu
Am Montag, dem 25.04.2022 um 21:32 +0200 schrieb Tinu Weber via arch- general:
On Mon, Apr 25, 2022 at 20:43:05 +0200, Frank via arch-general wrote:
However, I still have the issue that I cannot execute any command. Is this to do with the following mesasge ? -bash: /etc/profile: Permission denied
This looks more like it's trying to execute /etc/profile rather than source it.
But I don't see anything in your ~/.bashrc or ~/.profile that would cause that (unless any of the sourced files would do that, i.e. /etc/profile.d/vte.sh and /usr/share/powerline/bindings/bash/powerline.sh).
I didn't touch them and cannot find anything in there which would cause this to happen. THX Frank
On Mon, 25 Apr 2022 17:57:15 +0200 Frank via arch-general <arch-general@lists.archlinux.org> wrote: [snip]
#add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/"
Others have pointed out the syntactic problem here, but I would like to ask about the semantics. I would expect the exact opposite ordering. There doesn't seem any point in specifiying core to override vendor, which overrides site. In what circumstances is that useful? I can understand the other way around where the vendor provides something better than standard perl, or you yourself have installed or written something better than either.
Am Montag, dem 25.04.2022 um 20:25 +0100 schrieb Dave Howorth via arch- general:
On Mon, 25 Apr 2022 17:57:15 +0200 Frank via arch-general <arch-general@lists.archlinux.org> wrote:
[snip]
#add Perl and Perl modules to file path export PATH="$(PATH):/usr/bin/core_perl/" export PATH="$(PATH):/usr/bin/vendor_perl/" export PATH="$(PATH):/usr/bin/site_perl/"
Others have pointed out the syntactic problem here, but I would like to ask about the semantics. I would expect the exact opposite ordering.
There doesn't seem any point in specifiying core to override vendor, which overrides site. In what circumstances is that useful?
I can understand the other way around where the vendor provides something better than standard perl, or you yourself have installed or written something better than either.
I son't recall when I put this in my .profile, there's been an anouncement to do so a while ago. However, as said this can be removed since /etc/profile.d/perlbin.sh is taking care of this now.
I wasn't aware that environment setup shouldn't go into .bashrc, but into .profile. Good to know, thank you! Here's how I have it now: # # ~/.profile # path_prefixes=( ~/.local/bin ~/.cargo/bin /opt/cuda/bin ) export PATH="$(printf "%s:" "${path_prefixes[@]}")$PATH" # # ~/.bash_profile # [[ -r ~/.profile ]] && . ~/.profile [[ -r ~/.bashrc ]] && . ~/.bashrc Galdor
participants (7)
-
2QdxY4RzWzUUiLuE@potatochowder.com
-
Dave Howorth
-
Frank
-
Galdor Takacs
-
Jonathon Fernyhough
-
Mike Cloaked
-
Tinu Weber