From 91e8c7a186b416ecc397e1a1406afac6a8132015 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 13 Nov 2015 13:56:19 +1300 Subject: Remove unneeded intermediate var --- bin/sue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/sue b/bin/sue index 1c0ca10f..b626aafc 100755 --- a/bin/sue +++ b/bin/sue @@ -33,13 +33,9 @@ case $1 in ;; esac -# Pull arguments into an array -declare -a files -files=("$@") - # Iterate through the files and check they all have the same owner user= -for file in "${files[@]}" ; do +for file ; do # Use stat(1) to get the file owner if ! file_owner=$(stat -c %U -- "$file") ; then @@ -63,5 +59,5 @@ done # If we got this far, there's at least one file and all the files are owned by # the same user; we can safely edit them -exec sudoedit -u "$user" -- "${files[@]}" +exec sudoedit -u "$user" -- "$@" -- cgit v1.2.3