Skip to content

Commit 782cc2f

Browse files
AnastasiiaAnastasiia
authored andcommitted
done bash script
1 parent 5910c27 commit 782cc2f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/find_bash_users.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
PASSWD_FILE="${1:-/etc/passwd}"
2+
3+
if [[ ! -r "$PASSWD_FILE" ]]; then
4+
echo "Error: Cannot read file '$PASSWD_FILE'" >&2
5+
exit 1
6+
fi
7+
8+
awk -F: '$7 == "/bin/bash" { print $1 }' "$PASSWD_FILE"

0 commit comments

Comments
 (0)