diff options
| author | mo khan <mo.khan@gmail.com> | 2019-10-14 09:53:56 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2019-10-14 09:53:56 -0600 |
| commit | 64397c35fb21db7d47d0182eeaa44c2070fc6afa (patch) | |
| tree | a640862b44042076dcc18095cee9792c425785fc /README.md | |
| parent | 9c63abb0a154c526a480ec8b82672e3252e3f4c3 (diff) | |
Add unit tests
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. |
