summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/README.md b/README.md
index 28a1972..bbc7e94 100644
--- a/README.md
+++ b/README.md
@@ -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.