aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc
Commit message (Collapse)AuthorAgeFilesLines
* Use -e test to be consistentTom Ryder2016-12-191-1/+1
|
* Defer kshrc loading until after shrc all loadedTom Ryder2016-12-181-0/+3
|
* Move HOSTNAME call into shrcTom Ryder2016-12-171-0/+3
|
* Remove setterm(1) callTom Ryder2016-12-031-3/+0
| | | | More trouble than it's worth
* Terser way to implement quiet command failuresTom Ryder2016-12-031-3/+1
| | | | Wrap it in curly brackets to make it a compound command
* Split ~/.shrc off stub ~/.shinit fileTom Ryder2016-12-031-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | NetBSD sh(1) and possible others don't tolerate a `return` short-circuit for ENV, which means that because that implementation also sources ENV if set regardless of whether the shell is interactive or not, all of the interactive stuff in ~/.shrc and ~/.shrc.d gets uselessly sourced and loaded up for non-interactive invocations of sh(1). To work around this, I've set ENV to be a new ~/.shinit file instead, which sources the ~/.shrc file only if the shell is interactive. ~/.shinit is the filename suggested in the man page for NetBSD sh(1) and Debian dash(1) as well. NetBSD's documented behaviour seems to be contrary to POSIX 2003: > ENV: This variable, when and only when an interactive shell is > invoked, shall be subjected to parameter expansion (see Parameter > Expansion ) by the shell, and the resulting value shall be used as a > pathname of a file containing shell commands to execute in the > current environment. No matter; this works fine, and makes non-interactive invocations of sh(1) on NetBSD much faster.
* setterm(1) isn't as standard as I thoughtTom Ryder2016-12-011-3/+5
| | | | | | | | | | | | | | | | | It's not available on default installs of any of the three major open-source BSDs, and isn't specified by POSIX. I only noticed this because the implement of sh(1) in NetBSD 7.0 seems to emit errors from calls to `command -p` to the terminal, regardless of any redirection of standard output and error: $ uname -a NetBSD faeroes 7.0.1_PATCH NetBSD 7.0.1_PATCH (GENERIC.201607220540Z) amd64 $ command -p setterm setterm: not found $ command -p setterm >/dev/null setterm: not found $ command -p setterm >/dev/null 2>&1 setterm: not found
* Move HISTSIZE and MAILCHECK to shrcTom Ryder2016-09-011-0/+6
| | | | Turns out they're POSIX variables!
* Move bash-independent code ~/.bashrc -> ~/.shrcTom Ryder2016-08-271-0/+9
|
* Remove default PS1 for shTom Ryder2016-08-251-5/+0
|
* Set POSIX PS1 in a less silly wayTom Ryder2016-08-231-1/+1
|
* Set POSIX PS1 before loading subscriptsTom Ryder2016-08-231-0/+5
| | | | So that it's overridden in the correct order by pdksh
* Use consistent syntax for sh source loopsTom Ryder2016-08-181-4/+3
|
* Move interactive tests back into *rc filesTom Ryder2016-08-171-0/+6
| | | | | | I don't fully understand why I have to do it this way yet, but if I don't, calling SSH with a command raises "stdin: not a terminal" because ~/.bashrc was called.
* Move simple Bash/pdksh functions into POSIX shTom Ryder2016-08-171-0/+7
Have only translated the scripts that translate readily into POSIX sh for now. More complex stuff like that bd/pd/sd/ud navigation for Bash doesn't port as easily, mostly because there isn't an analogue for the "local" keyword in POSIX.