Skip to content

Commit 59f8718

Browse files
authored
Add script to find users with bash shell
Script checks for a specified file and lists users with bash shell.
1 parent 2cc392d commit 59f8718

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

find_bash_users.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
FILE=${1:-/etc/passwd}
4+
5+
if [ ! -f "$FILE" ]; then
6+
echo "Error"
7+
exit 1
8+
fi
9+
10+
echo "Users in file $FILE:"
11+
12+
grep '/bin/bash$' "$FILE" | cut -d: -f1

0 commit comments

Comments
 (0)