title bp
section 1
project bgscripts-core
volume General Commands Manual
date July 2020
=====
NAME
  bp - dot-sourceable bash profile
SYNOPSIS
  source bp [--fcheck] [--noglobalprofile] [--nodeps] [--noos] [--noflavor] [--clear]
PARAMETERS
  [--fcheck]   Only show script version number and exit. Added for compatibility of a certain era with all of `bgstack15` scripts.

  [--noglobalprofile] omit loading /etc/bashrc (on Linux only)

  [--nodeps] same as --noos and --noflavor

  [--noos] omit loading /usr/share/bgscripts/bashrc.d/${thisos}.bashrc

  [--noflavor] omit loading /usr/share/bgscripts/bashrc.d/${thisflavor}.bashrc. This is the main one that catches, for redhat, centos, devuan, ubuntu, etc.

  [--clear] clear screen and show tty number at top.
DESCRIPTION

  SIMPLE VARIABLES
Dot-source this script to load the bgstack15 profile. It is undetermined if `bp` stands for *bgstack15 profile*, or *bash profile*.
Set these variables.
* thisos  Linux or FreeBSD
* thisflavor  redhat, centos, ubuntu, etc.
* thisflavorversion  7.1, 2.1, etc.
* SERVER
* today
* VISUAL=vi
* EDITOR=$VISUAL
* BC_ENV_ARGS=~/.bcrc
  bp also runs `set -o vi`

  SIMPLE ALIASES
* where
* cl='clear;clear'
* glc is an abbreviated git log in color

  SIMPLE FUNCTIONS
* psg  ps | grep
* lsf  ls files
* lsd  ls directories
* ll
* lr
* cx  chmod +x
* now  datestamp
* vir  vi dashR
* own  chown to self
* sshg  ssh with GSSAPI auth only
* sshk  ssh with publickey auth only
* sshp  ssh with password only
* idg  show group memberships of user

  COMPLEX FUNCTIONS
* cdmnt  deprecated
* newest

  call: newest . matchpattern
  Useful when viewing latest log file in a directory.
  example: tail -f $( newest /var/log/sssd sssd_ipa.example.com )
* newer
* cdnewest  deprecated
* ccat  color cat
* htmlize  convert < to &lt; and so on
* permtitle  set terminal window title from PROMPT_COMMAND, with attempt at caching original title
* xdg-what  what program will open this file
* find-git-merged

  call $EDITOR $(find-git-merged)
  Useful when manually merging a git source tree. It finds all files with the git `<<<<<<<|=======|>>>>>>>` conflict headings.
* resize_screen  same as `resize-x(1)`
* clean_known_hosts

  call: clean_known_hosts 8
  Removes entries from `~/.ssh/known_hosts`, either by pattern matching or line number.
  example: clean_known_hosts clonetemplate
* ask_patch

  call: ask_patch ~/dev/stackrpms/freefilesync 1 .
  Ask for each .patch file in $1 to directory $3, and use patch -p $2.
  I wrote this to make it easier to apply my Fedora patches to the FreeFileSync source tree, when testing the raw build action.

  BASH AUTOCOMPLETION
* for `bounce(1)`
* pack (deprecated)
* for resize_screen
AUTHOR
  Ben Stack <bgstack15@gmail.com>
BUGS
  Includes several bash completions inline, so it fails `sh -n`, but otherwise it technically works in dash. The $PS1 is not correctly interpreted by dash.
SEE ALSO
`bash(1)`
Read the script itself, `/usr/bin/bp` which is just shell.
