How to apply a bash script just to one user account?
My understanding is that you send a script to your remote systems.  You then run the script. I'm not sure what user id the script will be run under. I don't know what you want to do for that user. 

You could put the following header code in a script.  It figures out if the user is an admin user or a non admin user.  

There are many ways to check for admin. Note: Some of the methods shown don't work.  See:

https://superuser.com/questions/279891/list-all-members-of-a-group-mac-os-x

This bash script lists all members of the group admin.

group=admin;
for i in $(dscl . list /users);
  do [[ $(id -nG $i | grep $group) ]] &amp;&amp; echo $i;
done;rc=0 


Distilling it down.

#!/bin/bash
# ideas from:
# https://www.symantec.com/connect/articles/mac-commands-directory-editor-dscl-and-custom-inventory
# https://superuser.com/questions/279891/list-all-members-of-a-group-mac-os-x
#
# Please note this is prototype.
#
#       THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  
#       IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  
#       FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  
#       AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  
#       LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  
#       OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  
#       SOFTWARE.

group=admin;
for i in $(dscl . list /users);
  do
    echo "process user ${i}"
    uniqueID=$(dscl  /Local/Default -read /Users/${i} UniqueID | awk '{ print $2 }')

    # exclude system-created users, which have IDs below 500
    if [ "${uniqueID:-0}" -ge 500 ]; then
      if  [[ $(id -nG $i | grep $group) ]]; then 
        #echo "${i} is a member of ${group}"
        #-- plan english
        echo "${i} is an admin user."
      else
        echo
        #echo "${i} isn't a member of ${group}"
        #-- plan english
        echo "${i} is a regular user..."
        # print the user's home folder
        homeDirectory=$(dscl  /Local/Default -read /Users/${i} NFSHomeDirectory | awk '{ print $2 }')
        echo "Home directory is ${homeDirectory}"
        echo
     fi
    fi
done
# leave a good impression on the caller
rc=0


finding if current user is an admin

  echo "Current user is " ${USER}
    if [[ $(id -nG ${USER} | grep "admin" ) ]]; then
      echo "admin user"
    else
      echo "regular user"
    fi