host info updates
[distro-setup] / .bash_profile
1 #!/bin/bash
2 # I, Ian Kelling, follow the GNU license recommendations at
3 # https://www.gnu.org/licenses/license-recommendations.en.html. They
4 # recommend that small programs, < 300 lines, be licensed under the
5 # Apache License 2.0. This file contains or is part of one or more small
6 # programs. If a small program grows beyond 300 lines, I plan to switch
7 # its license to GPL.
8
9 # Copyright 2024 Ian Kelling
10
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14
15 # http://www.apache.org/licenses/LICENSE-2.0
16
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22
23 # info bash covers everything comprehensively of course. i use ~/.bash_profile
24 # to source bashrc, and .profile just echos that the normal bash startup process
25 # is not happening. I don't source bashrc in posix mode based on debian's
26 # default, and posix mode is quirky, doesn't seem worth figuring it out This
27 # setup ensures no distro can override anything, as they occasionally do things
28 # I don't like. For example, debian's root .profile spamms with "mesg n"when
29 # there is no tty. The mesg n ensures the terminal is not writable by other
30 # users, but it is that way without the mesg n, and google search, and debian
31 # wiki search, /usr/share/doc search gives no justification for it, and it's not
32 # in fedora, so I'm pretty confident that it is useless redundant security, plus
33 # it is purposefully in a user startup file, not a system one, so intended for
34 # the user to change.
35
36 # History related options first, or else
37 # we risk screwing up history history. And this is duplicated
38 # in ~/.bash_profile just for good measure
39 # history number. History expansion is good.
40 PS4='$LINENO+ '
41 # history file size limit, set to unlimited.
42 # this needs to be different from the default because
43 # default HISTFILESIZE is 500 and could clobber our history
44 HISTFILESIZE=
45 # max commands 1 session can append/read from history
46 HISTSIZE=1000000
47 # the time format display when doing the history command
48 # also, setting this makes the history file record time
49 # of each command as seconds from the epoch
50 HISTTIMEFORMAT="%Y-%m-%d %I:%M %p "
51 # consecutive duplicate lines dont go in history
52 HISTCONTROL=ignoredups
53 # works in addition to HISTCONTROL to do more flexible things
54 # it could also do the same things as HISTCONTROL and thus replace it,
55 # but meh. dunno why, but just " *" does glob expansion, so use [ ] to avoid it.
56 HISTIGNORE='pass *:[ ]*:otp *:oathtool *'
57
58
59 # shellcheck source=/a/bin/ds/.bashrc
60 [[ -f ~/.bashrc ]] && . ~/.bashrc
61 # ensure no bad programs appending to this file will have an affect
62 return 0