diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1171,11 +1171,9 @@ Rootly Powers and Processes ```bash #!/bin/bash - if [[ "$OSTYPE" == "darwin"* ]]; then - cat /etc/passwd | cut -d: -f1,3 | grep ':0' - else - cat /etc/passwd | grep -P '^\w+:[x]:\d+:0.*$' - fi + FILE=${1:-'/etc/passwd'} + + cat "$FILE" | cut -d: -f1,3 | grep ':0' ``` b. Find entries that have no password (needs /etc/shadow). @@ -1183,7 +1181,9 @@ Rootly Powers and Processes ```bash #!/bin/bash - grep -E '^\w+::.*' /etc/passwd + FILE=${1:-'/etc/passwd'} + + grep -E '^\w+::.*' $FILE ``` c. Find any sets of entries that have duplicate UIDs. |
