Compare commits

3 Commits

5 changed files with 34 additions and 7 deletions

View File

@@ -5,4 +5,4 @@
- **trans.sh**: a [linguee.com](https://linguee.com) based command-line translator.
- **sync.sh**: a rsync/ssh backup tool.
- **sync-conf-example.sh**: configuration example.
- **dup-live-disk.sh**: duplicate (possibly live) disk partitions.
- **dup-live-disk.sh**: duplicate (**possibly live**) disk partitions.

View File

@@ -565,8 +565,8 @@ parse_opts() {
local c2="" c3=""
local -i i
if ! tmp=$(getopt -o "$sopts" -l "$lopts" -n "$CMD" -- "$@"); then
log "Use '$CMD --help' or '$CMD --man' for help."
if ! tmp=$(getopt -o "$sopts" -l "$lopts" -n "$CMDNAME" -- "$@"); then
log "Use '$CMD --help' or 'zob $CMDNAME --man' for help."
exit 1
fi

17
config/home/.bash_profile Normal file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# ~/.bash_profile - bash login script.
#
# (C) Bruno Raoult ("br"), 2024
# Licensed under the GNU General Public License v3.0 or later.
# Some rights reserved. See COPYING.
#
# You should have received a copy of the GNU General Public License along with this
# program. If not, see <https://www.gnu.org/licenses/gpl-3.0-standalone.html>.
#
# For login shells, ~/.profile is executed. Debian default one does:
# 1) source .bashrc if it exists
# 2) add "$HOME"/bin in PATH
# This imply a duplicate "$HOME/bin" in PATH, as we do everything in .bashrc.$user.
[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc"

View File

@@ -2,7 +2,7 @@
#
# ~/.bashrc.br - user specific initialization
#
# (C) Bruno Raoult ("br"), 2001-2023
# (C) Bruno Raoult ("br"), 2001-2024
# Licensed under the GNU General Public License v3.0 or later.
# Some rights reserved. See COPYING.
#
@@ -14,6 +14,12 @@
# Usage: to be invoked from .bashrc.
# i.e., add at the end of .bashrc:
# [ -f "$HOME/.bashrc.$USER" ] && . "$HOME/.bashrc.$USER"
#
# Debian default ~/.profile does:
# 1) source .bashrc if it exists
# 2) add "$HOME"/bin in PATH
# This imply a duplicate "$HOME/bin" in PATH, as we do everything here.
# Better to have a ~/.bash_profile with the lines above.
# _var_del() - remove an element from a colon-separated list.
# $1: name (reference) of a colon separated list

View File

@@ -2,7 +2,7 @@
#
# ~/.bashrc.br.lorien - host specific initialization
#
# (C) Bruno Raoult ("br"), 2001-2023
# (C) Bruno Raoult ("br"), 2001-2024
# Licensed under the GNU General Public License v3.0 or later.
# Some rights reserved. See COPYING.
#
@@ -44,17 +44,21 @@ fi
# The alias, when invoked, will:
# (1) change working directory to $1
# (2) source $3 when $3 is not '-'. $3 path can be relative (preferred), or
# absolute. If $3 is "+", it will default to "./scripts/env.sh".
# absolute. If $3 is "+", it will default to "scripts/env.sh".
#
# Examples:
# _vardir MYDIR mydir - ~/foo/mydirprj
_vardir() {
local _v="$1" _a="$2" _s="$3" _p="$4"
if [[ ! -d $_p ]]; then
printf "ignored project: %s\n" "$_p"
return 0
fi
local _x="cd $_p"
export "$_v"="$_p"
case "$_s" in
-) ;;
+) _s="./scripts/env.sh" ;&
+) _s="scripts/env.sh" ;&
*) if [[ -r "$_p/$_s" ]]; then
_x+="; . $_s"
else