install instructions for PATH don't insert a newline #705

Closed
opened 2025-10-22 14:55:45 +00:00 by kimadactyl · 4 comments

Heya, just ran the install instructions and this step didn't work:

echo PATH=$PATH:/Users/kim/.local/bin >> /Users/kim/.zshrc

It concatenated it with the last line in my .zshrc instead of adding it to a new line. on adding the line manually it's working again.

.zsh / macos / iterm2

Heya, just ran the install instructions and this step didn't work: `echo PATH=$PATH:/Users/kim/.local/bin >> /Users/kim/.zshrc` It concatenated it with the last line in my .zshrc instead of adding it to a new line. on adding the line manually it's working again. .zsh / macos / iterm2
Owner

Hey @kimadactyl, thanks for the report.

That's strange however, I thought echo foo >> foo always adds the newline? Is this perhaps something to do with with a missing newline in your .zshrc at the time? Can you manually test that echo TEST >> /Users/kim/.zshrc definitely misses the newline?

We don't have any logic atm in the installer script that deals with newlines:

com="echo PATH=\$PATH:$p"
if [[ $SHELL =~ "bash" ]]; then
echo "$com >> $HOME/.bashrc"
elif [[ $SHELL =~ "fizsh" ]]; then
echo "$com >> $HOME/.fizsh/.fizshrc"
elif [[ $SHELL =~ "zsh" ]]; then
echo "$com >> $HOME/.zshrc"
else
echo "$com >> $HOME/.profile"
fi

Hey @kimadactyl, thanks for the report. That's strange however, I thought `echo foo >> foo` always adds the newline? Is this perhaps something to do with with a missing newline in your `.zshrc` at the time? Can you manually test that `echo TEST >> /Users/kim/.zshrc` definitely misses the newline? We don't have any logic atm in the installer script that deals with newlines: https://git.coopcloud.tech/toolshed/abra/src/commit/fd4ee75ab72bdc6668ba0b09a99fe140dd51b9c2/scripts/installer/installer#L92-L101
decentral1se added the
installer
label 2025-10-23 06:59:38 +00:00
Author

yeah it works normally! and your example works too.

$ echo TEST >> ./test
$ echo TEST >> ./test
$ echo TEST >> ./test
$ cat test
TEST
TEST
TEST
yeah it works normally! and your example works too. ``` $ echo TEST >> ./test $ echo TEST >> ./test $ echo TEST >> ./test $ cat test TEST TEST TEST ```
Owner

@kimadactyl OK 🤔 Then I really don't know what originally would have caused the issue? If you have ideas, I'm happy to hear it. Otherwise, shall we just assume this was a ghost in your computer and close the issue? 😛

@kimadactyl OK 🤔 Then I really don't know what originally would have caused the issue? If you have ideas, I'm happy to hear it. Otherwise, shall we just assume this was a ghost in your computer and close the issue? 😛
Author

yep ok ill reopen if i can reproduce!

yep ok ill reopen if i can reproduce!
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#705
No description provided.