case "$0" in *\b\a\s\h) set -o posix;; esac export MAIL=$HOME/.mail # mail -f ~/.mail export MAILCHECK # i dont think this works with maildir format export PATH=$HOME/bin:$HOME/local/bin:$PATH # chmod +x ~/bin/script.sh export MANPATH=$HOME/local/share/man: # note the : at the end export CDPATH=.:$HOME:.. # make cd act as if $HOME is always $PWD export TZ=Australia/Canberra export EDITOR=vi export PS1='\H:${PWD##*/}:$?\$ ' # hostname:pwd:0$ prompt profile() { . ~/.profile "$@"; } # reload profile tg() { fg %-; } # restore other suspended process word() { shuf -n "${1:-1}" -r /usr/share/dict/words; } # random word(s), see https://xkcd.com/936/ # dofor 'echo -n' * # ls | forline echo -n dofor() (command=$1; shift; for arg; do command=$command $command "$arg"; done) forline() (while read -r line; do "$@" "$line"; done) # find . -print0 | while readstr; do stat "$str"; done readstr() { str=$(getstr && echo eof) && str=${str%eof}; } # ech0 printf '%s\n' 'args =1' =2 | ssh0 pa36op ech0() { printf '%s\0' "$@"; } ssh0() { ssh "$@" exec xargs -0 -r env; } # echo -n considered harmful ecto() { cat << eot $@ eot } echoe() { printf %b\\n "$*"; } ddg() { w3m "https://lite.duckduckgo.com/lite/?q=$*"; } hello() { echo hello world; } # usage: sh ~saor/.profile hello # usage: ~saor/.profile hello # usage: . ~saor/.profile hello # usage: ssh tilde.club sh /home/saor/.profile exec printenv "$@"