OILS / demo / bash-startup.sh View on Github | oilshell.org

32 lines, 12 significant
1#!/usr/bin/env bash
2#
3# Usage:
4# demo/bash-startup.sh <function name>
5
6set -o nounset
7set -o pipefail
8set -o errexit
9
10# https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
11
12# Looks at /etc/profile first, which is documented.
13login-shell() {
14 strace -e open bash --login
15}
16
17# Looks at /etc/bash.bashrc first. How does it find this?
18regular-shell() {
19 strace -e open bash
20}
21
22# OK it's in here, but I don't see it documented. Is it Debian-specific?
23
24# In config-top.sh in the bash tree, I see this. So Debian must turn this on.
25#
26# /* System-wide .bashrc file for interactive shells. */
27# /* #define SYS_BASHRC "/etc/bash.bashrc" */
28search-bin() {
29 strings /bin/bash | grep bashrc
30}
31
32"$@"