Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    A good etiquette rule on StackExchange is to give a reason while down-voting. I looked through the question and other answers, and see no particular problem with mine. I don't think that my answer is better than others, but it has two good points: a) it is original, it proposes a new distinct solution b) it references the sources of information. If the answer is any wrong, feel free to correct that. Commented Jan 22, 2022 at 15:52
  • No idea why this was ever downvoted. This is a great way to set the PATH. It works both in FreeBSD and Linux (although executed twice in Linux, no idea why). Unlike ~/.profile it's executed for both interactive and non-interactive shells. Unlike ~/.ssh/environment you can use commands and variables like any shell script. Unlike BASH_ENV it's executed once (or twice) instead of sourced at the start of every shell script. Perfect. Commented May 27, 2022 at 18:11
  • 6
    oops, I spoke too soon. ~/.ssh/rc is executed, not sourced. So you can run some commands but they will not change the env. You can't set the PATH with this. Commented May 27, 2022 at 21:11
  • @Daniel - many thanks for your remark! Today I don't know whether that worked for me that time and why I posted that. Maybe just read the manuals? Or could it be sourced on some environments? Maybe I shall leave this answer at the moment and upvote your comment. Commented May 29, 2022 at 8:23