X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Ffiles%2Ffind_non_owned.sh;h=d5818a3d2bb1c531a5cd21138966878ebadbe94e;hb=refs%2Fheads%2Fmain;hp=65555b69897a41ad04a1aa097c928bd0d7ffd822;hpb=74975aa423327346f2e2c62149e08570f22fd72d;p=feisty_meow.git diff --git a/scripts/files/find_non_owned.sh b/scripts/files/find_non_owned.sh index 65555b69..5c48dbed 100644 --- a/scripts/files/find_non_owned.sh +++ b/scripts/files/find_non_owned.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash if test $# = 0; then echo $(basename $0): needs at least one directory name as a parameter. #hmmm: set the first parm to . instead. @@ -6,14 +6,14 @@ if test $# = 0; then fi; export outfile="$(mktemp "$TMP/zz_findertmp.XXXXXX")" # check for files not owned by the user. -echo "These files are not self-owned by $USER:" >$outfile +echo "These files are not self-owned by $(sanitized_username):" >$outfile for i; do - find $i ! -user $USER >>$outfile + find $i ! -user $(sanitized_username) >>$outfile done # check for files not in same group as the user. GROUP="$(groups | awk '{print $1}')" # assumption above that the first group is the 'primary' one. -echo "These files are owned by primary group of $GROUP:" >>$outfile +echo "These files are not owned by primary group of $GROUP:" >>$outfile for i; do find $i ! -group $GROUP >>$outfile done