Что такое эквивалент Debian для /etc/bashrc?

#! /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
4
03.03.2020, 14:52
2 ответа

В справочной странице 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 исправил справочную страницу, чтобы отразить, что она используется..

8
28.04.2021, 23:21

Вам это поможет? В моем Debian Buster:

find /etc -type f -name "*bashrc*" 2> /dev/null
/etc/skel/.bashrc
/etc/bash.bashrc
7
28.04.2021, 23:21

Теги

Похожие вопросы