Score:1

Bash export errors when ssh-ing in

qa flag

Context: I am running an Ubuntu 22.04.1 virtual machine on my firewall using trueNAS and I solely interact with it using ssh

Whenever I start a new terminal session I get these two messages:

-bash: export: `PATH#': not a valid identifier
-bash: export: `15': not a valid identifier

This issue has been happening for awhile and I have not noticed it causing any other issues. I haven't tried anything since I don't know what the problem is.

Edits:

Output for

grep -P 'export .*(15|PATH#)' ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login ~/.bash_aliases /etc/bash.bashrc /etc/profile /etc/profile.d/* /etc/environment 2> /dev/null

is

/etc/profile:export PATH# OpenJDK 15
mchid avatar
bo flag
What does `grep export ~/.bashrc` return? If this does not return the offending lines that start with `export 15` and/or `export PATH#` check `grep export ~/.profile` and `grep export /etc/profile`, `grep export /etc/environment` and `grep export /etc/bash.bashrc`.
terdon avatar
cn flag
@mchid no need for separate commands. Thewolfhearted please [edit] your question and show us the output of running `grep -P 'export .*(15|PATH#)' ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login ~/.bash_aliases /etc/bash.bashrc /etc/profile /etc/profile.d/* /etc/environment 2> /dev/null` on your Ubuntu machine.
mchid avatar
bo flag
@terdon Yeah, I figured that most people sanitize their username and didn't want to have to go through with explaining all of that. Although, I probably should've put `/etc/environment` as the second or third on the list so the first three would be the most likely ones.
terdon avatar
cn flag
Oh, it was more about not making the OP run one grep per file when they can just run a single grep on all files. I happen to have a little function for this, so I took the list of files from there, I assumed we suggested the same ones.
Thewolfhearted avatar
qa flag
@terdon Fixed it! Hope that helps.
Score:0
in flag

There is a space missing in front of #.

Add the space manually with an editor or run,

sudo sed -i 's/PATH#/PATH #/' /etc/profile
Thewolfhearted avatar
qa flag
Doing the command provides a strange list of things that I provided above, any idea why this is happening?
pLumo avatar
in flag
sorry, I forgot the `-i` flag
Thewolfhearted avatar
qa flag
With the -i flag it provides no errors but still does not fix the issue.
pLumo avatar
in flag
My fault ... the command is correcft, but your issue is in `/etc/profile`, not in `~/.profile`. I edited once again, that should do it.
Thewolfhearted avatar
qa flag
im gonna remove the stuff regarding this since they are not needed for future use
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.