lots: shellcheck, streaming stuff, fixes
[distro-setup] / .bash_profile
1 #!/bin/bash
2 # info bash covers everything comprehensively of course. i use ~/.bash_profile
3 # to source bashrc, and .profile just echos that the normal bash startup process
4 # is not happening. I don't source bashrc in posix mode based on debian's
5 # default, and posix mode is quirky, doesn't seem worth figuring it out This
6 # setup ensures no distro can override anything, as they occasionally do things
7 # I don't like. For example, debian's root .profile spamms with "mesg n"when
8 # there is no tty. The mesg n ensures the terminal is not writable by other
9 # users, but it is that way without the mesg n, and google search, and debian
10 # wiki search, /usr/share/doc search gives no justification for it, and it's not
11 # in fedora, so I'm pretty confident that it is useless redundant security, plus
12 # it is purposefully in a user startup file, not a system one, so intended for
13 # the user to change.
14
15 # History related options first, or else
16 # we risk screwing up history history. And this is duplicated
17 # in ~/.bash_profile just for good measure
18 # history number. History expansion is good.
19 PS4='$LINENO+ '
20 # history file size limit, set to unlimited.
21 # this needs to be different from the default because
22 # default HISTFILESIZE is 500 and could clobber our history
23 HISTFILESIZE=
24 # max commands 1 session can append/read from history
25 HISTSIZE=1000000
26 # the time format display when doing the history command
27 # also, setting this makes the history file record time
28 # of each command as seconds from the epoch
29 HISTTIMEFORMAT="%Y-%m-%d %I:%M %p "
30 # consecutive duplicate lines dont go in history
31 HISTCONTROL=ignoredups
32 # works in addition to HISTCONTROL to do more flexible things
33 # it could also do the same things as HISTCONTROL and thus replace it,
34 # but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
35 HISTIGNORE='pass *:[ ]*:otp *:oathtool *'
36
37
38 # shellcheck source=/a/bin/ds/.bashrc
39 [[ -f ~/.bashrc ]] && . ~/.bashrc
40 # ensure no bad programs appending to this file will have an affect
41 return 0