File: cwd_show

package info (click to toggle)
python-mitogen 0.3.26-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,456 kB
  • sloc: python: 22,134; sh: 183; makefile: 74; perl: 19; ansic: 18
file content (22 lines) | stat: -rwxr-xr-x 439 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

# Show permissions and identities that impact the current working directory.
# On macOS libc cwd() can return EACCES after su or sudo.
# See also
#   - https://github.com/ansible/ansible/pull/7078
#   - https://github.com/python/cpython/issues/115911

set -o errexit
set -o nounset
set -o pipefail

whoami
groups
pwd

d=$(pwd)
while [[ "$d" != "/" && -n "$d" ]]; do
    ls -ld "$d"
    d=$(dirname "$d")
done
ls -ld /