Good afternoon,
I am having some issues figuring out exactly how to remove a list of items from an array if they match my criteria inside of my program. Example is below. I want to remove anything that has admin in it, regardless of case, as well as anything in a list of names.
#This array is a list of user name
declare -a userList=($(command to get users))
#now my userList array is filled with different usernames
#ex = user01 user02 user03 admin user04 Admin_user AdMiN-account user09
#I have a second list of names that I want to remove from the array stored in a variable. Pseudocode is below. test.txt contains **user01 and user02**
for i in ${exclude} ; do
remove name from array
done
code to remove any spelling of admin from userList array.
If a longer explanation is needed please let me know. Thank you.