Fix showing Reading when non-interactive

This commit is contained in:
Anthony Rose 2022-08-23 13:26:48 +01:00
parent 7bba951c6f
commit 62d6db7ce3
3 changed files with 3 additions and 5 deletions

View file

@ -1,6 +1,7 @@
#!/bin/bash
case "$-" in
*i*)
echo "[ Reading \"$HOME/.bashrc\" ]"
;;
*)
# Shell is not interactive.
@ -8,8 +9,6 @@ case "$-" in
;;
esac
echo "[ Reading \"$HOME/.bashrc\" ]"
if [ -f /etc/bashrc ]
then
. /etc/bashrc

View file

@ -4,10 +4,10 @@ then
echo "[ Ignoring \"$HOME/.shrc\" ]"
return 1
fi
echo "[ Reading \"$HOME/.shrc\" ]"
case "$-" in
*i*)
echo "[ Reading \"$HOME/.shrc\" ]"
;;
*)
# Shell is not interactive.

View file

@ -1,6 +1,7 @@
#!/bin/zsh
case "$-" in
*i*)
echo "[ Reading \"$HOME/.zshrc\" ]"
;;
*)
# Shell is not interactive.
@ -8,8 +9,6 @@ case "$-" in
;;
esac
echo "[ Reading \"$HOME/.zshrc\" ]"
if [ -f /etc/zshrc ]
then
. /etc/zshrc