#! /usr/bin/env bash
# exit on error
set -e
# increase the numbers of the old archives (mv -i avoids accidental overwrite)
for ((i=999; i >= 2; i--)); do
for name in access error; do
if [[ -e /var/log/archives/$name.log.$i ]]; then
mv -i "/var/log/archives/$name.log.$i" "/var/log/archives/$name.log.$((i+1))"
fi
done
done
# move current files to archives
for name in access error; do
mv -i "/root/test/$name.log.1" "/var/log/archives/$name.log.2"
done
В справочной странице Debian для Bash говорится
When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if these files exist.
Таким образом, ответ, который вы ищете, кажется /etc/bash.bashrc
.
В собственной документации Bash упоминается только ~/.bashrc
, но наличие системы -в масштабе bashrc
можно настроить во время компиляции , и Debian исправил справочную страницу, чтобы отразить, что она используется..
Вам это поможет? В моем Debian Buster:
find /etc -type f -name "*bashrc*" 2> /dev/null
/etc/skel/.bashrc
/etc/bash.bashrc