Skip to content

Commit b6cddde

Browse files
committed
Add find_bash_users.sh (list users with /bin/bash)
1 parent 4d280b6 commit b6cddde

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/find_bash_users.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
if command -v getent >/dev/null 2>&1; then
4+
getent passwd | awk -F: '$7 ~ /\/bin\/bash$/ {printf "%-20s %s\n", $1, $7}'
5+
else
6+
awk -F: '$7 ~ /\/bin\/bash$/ {printf "%-20s %s\n", $1, $7}' /etc/passwd
7+
fi

0 commit comments

Comments
 (0)