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