mysrc /a/bin/small-misc-bash/ll-function
mysrc /a/bin/distro-functions/src/package-manager-abstractions
+mysrc /a/bin/fai/fai/config/distro-install-common/bash-misc-funcs
# things to remember:
# ALT-C - cd into the selected directory
m() { printf "%s\n" "$*"; "$@"; }
m2() { printf "%s\n" "$*" >&2; "$@"; }
-# update file. note: duplicated in mail-setup.
-# updates $ur u result to true or false
-# updates $reload to true if file updated is in /etc/systemd/system
-u() {
- local tmp tmpdir dest="$1"
- local base="${dest##*/}"
- local dir="${dest%/*}"
- if [[ $dir != "$base" ]]; then
- # dest has a directory component
- mkdir -p "$dir"
- fi
- # shellcheck disable=SC2034 # see comment at top of function
- ur=false # u result
- tmpdir="$(mktemp -d)"
- cat >$tmpdir/"$base"
- tmp=$(rsync -ic $tmpdir/"$base" "$dest")
- if [[ $tmp ]]; then
- printf "%s\n" "$tmp"
- # shellcheck disable=SC2034 # see comment at top of function
- ur=true
- if [[ $dest == /etc/systemd/system/* ]]; then
- # shellcheck disable=SC2034 # see comment at top of function
- reload=true
- fi
- fi
- rm -rf $tmpdir
-}
uptime() {
# titelbar below
#echo -ne "$_title_escape $HOSTNAME ${PWD/#$HOME/~} \007"
- if [[ $KONSOLE_VERSION ]]; then
+ # version 211203 does not have this feature.
+ if [[ $KONSOLE_VERSION && $KONSOLE_VERSION == [3456789]* || $KONSOLE_VERSION == 2[2456789]* ]]; then
# from konsole, output via ctrl-alt-]
if [[ ! $PS1 =~ 133 ]] ; then
PS1='\[\e]133;L\a\]\[\e]133;D;$?\]\[\e]133;A\a\]'$PS1'\[\e]133;B\a\]' ;