проверить, не установлены ли профили конфигурации для распознавания совпадающих имен - PullRequest
1 голос
/ 24 апреля 2020

Это часть гораздо большего инструмента диагностики c, который я создаю. Я управляю Mac на работе, и мне нужно подтвердить, что все профили конфигурации установлены, или отобразить список отсутствующих. Сценарии не моя сильная сторона, но я пытаюсь учиться. После нескольких дней проб и ошибок я наконец смог заставить работать код, но я получаю вывод, который не имеет смысла. У меня есть проверка сравнения, которая отлично работает для большинства профилей и возвращает ложные ошибки. Я знаю, что это действительно моя ошибка, но я не компьютер, поэтому есть деталь, которую я упускаю, ясно.

Вот краткое изложение кода ...

$ profileList это управляющий массив, содержащий имена профилей конфигурации, которые я хочу обеспечить. Я создал этот список, выполнив команду:

profiles -C -v | grep attribute | awk '/name/{$1=$2=$3=""; print $0}' | sed -e 's/^[ \t]*//'

на «известной исправной» машине и поместив имена, возвращенные в кавычки. $ missingProfiles - это пустой массив, в котором я буду хранить имена профилей, которые не были найдены, чтобы они могли отображаться в отчете.

Я немного изменил код, чтобы устранить неполадки при сравнении. Просто удалили несколько строк, которые устанавливают переменные для использования в другом месте в гораздо более длинном скрипте, и добавили эхо, чтобы увидеть, что на самом деле сравнивается.

#! /bin/bash

## Configuration Profiles
profileList=( "Chromium Edge" "Privacy Preferences Policy Control" "Security and Privacy" "Enterprise Connect" "System Restrictions" "Chrome Whitelist" "Network Configuration 2.0" "Chrome Extensions" "MAU_AppArray2019" "Approved Kernel Extensions" "Bomgar" "Office ProPlus 365" "ATP" "Chromium Edge Allowlist" "ScreenSaver Settings" "Disable Chrome Auto-Updates" "ShowDocStageOnLaunch" "MAU_AppArray" "MDM Profile" "macOSLAPS" "Browser Homepage" "Microsoft Auto Update Production""Office Preference Keys" )
missingProfiles=()

for i in "${profileList[@]}"; do
    checkProfile=$( profiles -C -v | awk -F: '/attribute: name/{print $NF}' | grep "$i" | sed -e 's/^[ \t]*//' )
    if [ ! "$checkProfile" == "$i" ]; then
        missingProfiles+=( "$i" );
        echo "i is $i"
        echo "checkProfile is $checkProfile"
    elif [ "$checkProfile" == "$i" ]; then
        echo "found $i"
        echo "found $checkProfile"
    fi
done

Вывод этого:

found ScreenSaver Settings
found ScreenSaver Settings
found Disable Chrome Auto-Updates
found Disable Chrome Auto-Updates
found Chrome Whitelist
found Chrome Whitelist
i is MAU_AppArray                                       <-- why is it trying to compare this
checkProfile is MAU_AppArray2019                        <-- with this which is not the same?
MAU_AppArray                                            <-- where did this come from???
found MDM Profile
found MDM Profile
found ShowDocStageOnLaunch
found ShowDocStageOnLaunch
found macOSLAPS
found macOSLAPS
found Microsoft Auto Update Production
found Microsoft Auto Update Production
found Office Preference Keys
found Office Preference Keys
found ATP
found ATP
found Approved Kernel Extensions
found Approved Kernel Extensions
i is Chromium Edge                                      <-- "Chromium Edge" doesn't match
checkProfile is Chromium Edge                           <-- "Chromium Edge"????? huh?!
Chromium Edge Allowlist                                 <-- Again, unexpected...
found Privacy Preferences Policy Control
found Privacy Preferences Policy Control
found Security and Privacy
found Security and Privacy
found Enterprise Connect
found Enterprise Connect
found Browser Homepage
found Browser Homepage
found System Restrictions
found System Restrictions
found Network Configuration 2.0
found Network Configuration 2.0
found Chrome Extensions
found Chrome Extensions
found MAU_AppArray2019
found MAU_AppArray2019
found Office ProPlus 365
found Office ProPlus 365
found Chromium Edge Allowlist
found Chromium Edge Allowlist
found Bomgar
found Bomgar

Я так близко ... Я надеюсь, что кто-то здесь может взглянуть и определить, что я сделал неправильно, что вызывает это.

РЕДАКТИРОВАТЬ

Добавление вывода профилей - C -v | grep 'attribute:' по запросу

_computerlevel[1] attribute: name: Chrome Whitelist
_computerlevel[1] attribute: configurationDescription: 
_computerlevel[1] attribute: installationDate: 2019-11-27 16:57:40 +0000
_computerlevel[1] attribute: organization: CompanyName Worldwide
_computerlevel[1] attribute: profileIdentifier: F3A66CB9-6847-4886-BAEF-D7577AEB816B
_computerlevel[1] attribute: profileUUID: F3A66CB9-6847-4886-BAEF-D7577AEB816B
_computerlevel[1] attribute: profileType: Configuration
_computerlevel[1] attribute: removalDisallowed: TRUE
_computerlevel[1] attribute: version: 1
_computerlevel[1] attribute: containsComputerItems: TRUE
_computerlevel[1] attribute: internaldata: TRUE
_computerlevel[2] attribute: name: Network Configuration 2.0
_computerlevel[2] attribute: configurationDescription: 
_computerlevel[2] attribute: installationDate: 2019-11-27 06:23:15 +0000
_computerlevel[2] attribute: organization: CompanyName Worldwide
_computerlevel[2] attribute: profileIdentifier: 524A33F3-6E6D-4A71-8404-E51D605BBF80
_computerlevel[2] attribute: profileUUID: 524A33F3-6E6D-4A71-8404-E51D605BBF80
_computerlevel[2] attribute: profileType: Configuration
_computerlevel[2] attribute: removalDisallowed: TRUE
_computerlevel[2] attribute: version: 1
_computerlevel[2] attribute: containsComputerItems: TRUE
_computerlevel[2] attribute: internaldata: TRUE
_computerlevel[3] attribute: name: Chrome Extensions
_computerlevel[3] attribute: configurationDescription: 
_computerlevel[3] attribute: installationDate: 2020-02-12 16:33:47 +0000
_computerlevel[3] attribute: organization: CompanyName Worldwide
_computerlevel[3] attribute: profileIdentifier: 7A2F528D-D5FD-4928-A70D-0B0FC9A91298
_computerlevel[3] attribute: profileUUID: 7A2F528D-D5FD-4928-A70D-0B0FC9A91298
_computerlevel[3] attribute: profileType: Configuration
_computerlevel[3] attribute: removalDisallowed: TRUE
_computerlevel[3] attribute: version: 1
_computerlevel[3] attribute: containsComputerItems: TRUE
_computerlevel[3] attribute: internaldata: TRUE
_computerlevel[4] attribute: name: MAU_AppArray2019
_computerlevel[4] attribute: configurationDescription: AppArray.plist registers the Office apps with MAU so they will be recognized and updated if never launched
_computerlevel[4] attribute: installationDate: 2020-03-06 15:16:14 +0000
_computerlevel[4] attribute: organization: CompanyName Worldwide
_computerlevel[4] attribute: profileIdentifier: 4577E363-29A6-45D2-BF8F-79008DA49D13
_computerlevel[4] attribute: profileUUID: 4577E363-29A6-45D2-BF8F-79008DA49D13
_computerlevel[4] attribute: profileType: Configuration
_computerlevel[4] attribute: removalDisallowed: TRUE
_computerlevel[4] attribute: version: 1
_computerlevel[4] attribute: containsComputerItems: TRUE
_computerlevel[4] attribute: internaldata: TRUE
_computerlevel[5] attribute: name: Approved Kernel Extensions
_computerlevel[5] attribute: configurationDescription: 
_computerlevel[5] attribute: installationDate: 2020-04-09 12:54:37 +0000
_computerlevel[5] attribute: organization: CompanyName Worldwide
_computerlevel[5] attribute: profileIdentifier: 9B96370D-BDD1-418E-B1DC-17DE0529F11D
_computerlevel[5] attribute: profileUUID: 9B96370D-BDD1-418E-B1DC-17DE0529F11D
_computerlevel[5] attribute: profileType: Configuration
_computerlevel[5] attribute: removalDisallowed: TRUE
_computerlevel[5] attribute: version: 1
_computerlevel[5] attribute: containsComputerItems: TRUE
_computerlevel[5] attribute: internaldata: TRUE
_computerlevel[6] attribute: name: Bomgar
_computerlevel[6] attribute: configurationDescription: 
_computerlevel[6] attribute: installationDate: 2020-02-18 18:38:46 +0000
_computerlevel[6] attribute: organization: CompanyName Worldwide
_computerlevel[6] attribute: profileIdentifier: 73ddbf1a-4f1e-48b9-bd24-69f8dc420aaa
_computerlevel[6] attribute: profileUUID: 73ddbf1a-4f1e-48b9-bd24-69f8dc420aaa
_computerlevel[6] attribute: profileType: com.apple.TCC.configuration-profile-policy
_computerlevel[6] attribute: removalDisallowed: TRUE
_computerlevel[6] attribute: version: 1
_computerlevel[6] attribute: containsComputerItems: TRUE
_computerlevel[6] attribute: internaldata: TRUE
_computerlevel[7] attribute: name: Office ProPlus 365
_computerlevel[7] attribute: configurationDescription: 
_computerlevel[7] attribute: installationDate: 2019-11-27 16:57:47 +0000
_computerlevel[7] attribute: organization: CompanyName Worldwide
_computerlevel[7] attribute: profileIdentifier: CDEB0EFC-453B-4918-8923-4B21F792F00D
_computerlevel[7] attribute: profileUUID: CDEB0EFC-453B-4918-8923-4B21F792F00D
_computerlevel[7] attribute: profileType: Configuration
_computerlevel[7] attribute: removalDisallowed: TRUE
_computerlevel[7] attribute: version: 1
_computerlevel[7] attribute: containsComputerItems: TRUE
_computerlevel[7] attribute: internaldata: TRUE
_computerlevel[8] attribute: name: ATP
_computerlevel[8] attribute: configurationDescription: 
_computerlevel[8] attribute: installationDate: 2020-03-16 13:43:15 +0000
_computerlevel[8] attribute: organization: CompanyName Worldwide
_computerlevel[8] attribute: profileIdentifier: FA6F8249-AACA-4EF9-912F-56DD498EB429
_computerlevel[8] attribute: profileUUID: FA6F8249-AACA-4EF9-912F-56DD498EB429
_computerlevel[8] attribute: profileType: Configuration
_computerlevel[8] attribute: removalDisallowed: TRUE
_computerlevel[8] attribute: version: 1
_computerlevel[8] attribute: containsComputerItems: TRUE
_computerlevel[8] attribute: internaldata: TRUE
_computerlevel[9] attribute: name: Chromium Edge Allowlist
_computerlevel[9] attribute: configurationDescription: 
_computerlevel[9] attribute: installationDate: 2020-03-16 16:09:28 +0000
_computerlevel[9] attribute: organization: CompanyName Worldwide
_computerlevel[9] attribute: profileIdentifier: F2B92C2D-69CC-4C15-AE52-F5986AD49D21
_computerlevel[9] attribute: profileUUID: F2B92C2D-69CC-4C15-AE52-F5986AD49D21
_computerlevel[9] attribute: profileType: Configuration
_computerlevel[9] attribute: removalDisallowed: TRUE
_computerlevel[9] attribute: version: 1
_computerlevel[9] attribute: containsComputerItems: TRUE
_computerlevel[9] attribute: internaldata: TRUE
_computerlevel[10] attribute: name: ScreenSaver Settings
_computerlevel[10] attribute: configurationDescription: 
_computerlevel[10] attribute: installationDate: 2019-11-27 16:57:49 +0000
_computerlevel[10] attribute: organization: CompanyName Worldwide
_computerlevel[10] attribute: profileIdentifier: 94536F86-3AAD-4F4B-87F9-CE338543F53F
_computerlevel[10] attribute: profileUUID: 94536F86-3AAD-4F4B-87F9-CE338543F53F
_computerlevel[10] attribute: profileType: Configuration
_computerlevel[10] attribute: removalDisallowed: TRUE
_computerlevel[10] attribute: version: 1
_computerlevel[10] attribute: containsComputerItems: TRUE
_computerlevel[10] attribute: internaldata: TRUE
_computerlevel[11] attribute: name: Disable Chrome Auto-Updates
_computerlevel[11] attribute: configurationDescription: 
_computerlevel[11] attribute: installationDate: 2019-11-27 16:57:46 +0000
_computerlevel[11] attribute: organization: CompanyName Worldwide
_computerlevel[11] attribute: profileIdentifier: F23C4E5B-F91F-4917-A6B3-DA77E7883A38
_computerlevel[11] attribute: profileUUID: F23C4E5B-F91F-4917-A6B3-DA77E7883A38
_computerlevel[11] attribute: profileType: Configuration
_computerlevel[11] attribute: removalDisallowed: TRUE
_computerlevel[11] attribute: version: 1
_computerlevel[11] attribute: containsComputerItems: TRUE
_computerlevel[11] attribute: internaldata: TRUE
_computerlevel[12] attribute: name: ShowDocStageOnLaunch
_computerlevel[12] attribute: configurationDescription: suppress design galleries for all Office products (PowerPoint, Word, Excel)
_computerlevel[12] attribute: installationDate: 2020-02-18 16:25:13 +0000
_computerlevel[12] attribute: organization: CompanyName Worldwide
_computerlevel[12] attribute: profileIdentifier: D9F5A6EF-0CDB-4FD8-9476-D3797CE09F1A
_computerlevel[12] attribute: profileUUID: D9F5A6EF-0CDB-4FD8-9476-D3797CE09F1A
_computerlevel[12] attribute: profileType: Configuration
_computerlevel[12] attribute: removalDisallowed: TRUE
_computerlevel[12] attribute: version: 1
_computerlevel[12] attribute: containsComputerItems: TRUE
_computerlevel[12] attribute: internaldata: TRUE
_computerlevel[13] attribute: name: MAU_AppArray
_computerlevel[13] attribute: configurationDescription: AppArray.plist registers the Office apps with MAU so they will be recognized and updated if never launched
_computerlevel[13] attribute: installationDate: 2019-11-27 16:57:39 +0000
_computerlevel[13] attribute: organization: CompanyName Worldwide
_computerlevel[13] attribute: profileIdentifier: F5C37198-E0F5-419F-9CDA-4E25168B5B52
_computerlevel[13] attribute: profileUUID: F5C37198-E0F5-419F-9CDA-4E25168B5B52
_computerlevel[13] attribute: profileType: Configuration
_computerlevel[13] attribute: removalDisallowed: TRUE
_computerlevel[13] attribute: version: 1
_computerlevel[13] attribute: containsComputerItems: TRUE
_computerlevel[13] attribute: internaldata: TRUE
_computerlevel[14] attribute: name: MDM Profile
_computerlevel[14] attribute: configurationDescription: MDM Profile for mobile device management
_computerlevel[14] attribute: installationDate: 2019-11-27 16:57:05 +0000
_computerlevel[14] attribute: organization: CompanyName Worldwide
_computerlevel[14] attribute: profileIdentifier: 00000000-0000-0000-A000-4A414D460003
_computerlevel[14] attribute: profileUUID: 00000000-0000-0000-A000-4A414D460003
_computerlevel[14] attribute: profileType: Configuration
_computerlevel[14] attribute: removalDisallowed: FALSE
_computerlevel[14] attribute: version: 1
_computerlevel[14] attribute: containsComputerItems: TRUE
_computerlevel[14] attribute: internaldata: TRUE
_computerlevel[15] attribute: name: macOSLAPS
_computerlevel[15] attribute: configurationDescription: 
_computerlevel[15] attribute: installationDate: 2019-11-27 16:57:48 +0000
_computerlevel[15] attribute: organization: CompanyName Worldwide
_computerlevel[15] attribute: profileIdentifier: A39A88CD-E2AE-4C20-A4E6-78807E066EA6
_computerlevel[15] attribute: profileUUID: A39A88CD-E2AE-4C20-A4E6-78807E066EA6
_computerlevel[15] attribute: profileType: Configuration
_computerlevel[15] attribute: removalDisallowed: TRUE
_computerlevel[15] attribute: version: 1
_computerlevel[15] attribute: containsComputerItems: TRUE
_computerlevel[15] attribute: internaldata: TRUE
_computerlevel[16] attribute: name: Browser Homepage
_computerlevel[16] attribute: configurationDescription: 
_computerlevel[16] attribute: installationDate: 2019-11-27 16:57:48 +0000
_computerlevel[16] attribute: organization: CompanyName Worldwide
_computerlevel[16] attribute: profileIdentifier: 0BB2B3A8-3F25-4C98-AB55-10E0DCD17C60
_computerlevel[16] attribute: profileUUID: 0BB2B3A8-3F25-4C98-AB55-10E0DCD17C60
_computerlevel[16] attribute: profileType: Configuration
_computerlevel[16] attribute: removalDisallowed: TRUE
_computerlevel[16] attribute: version: 1
_computerlevel[16] attribute: containsComputerItems: TRUE
_computerlevel[16] attribute: internaldata: TRUE
_computerlevel[17] attribute: name: Microsoft Auto Update Production
_computerlevel[17] attribute: configurationDescription: 
_computerlevel[17] attribute: installationDate: 2020-04-20 13:29:20 +0000
_computerlevel[17] attribute: organization: CompanyName Worldwide
_computerlevel[17] attribute: profileIdentifier: 9187EFD8-7FCF-4848-942A-F7E06BBF08CF
_computerlevel[17] attribute: profileUUID: 9187EFD8-7FCF-4848-942A-F7E06BBF08CF
_computerlevel[17] attribute: profileType: Configuration
_computerlevel[17] attribute: removalDisallowed: TRUE
_computerlevel[17] attribute: version: 1
_computerlevel[17] attribute: containsComputerItems: TRUE
_computerlevel[17] attribute: internaldata: TRUE
_computerlevel[18] attribute: name: Office Preference Keys
_computerlevel[18] attribute: configurationDescription: 
_computerlevel[18] attribute: installationDate: 2019-11-27 16:58:01 +0000
_computerlevel[18] attribute: organization: CompanyName Worldwide
_computerlevel[18] attribute: profileIdentifier: D369D410-0E42-44CD-BBA5-C972C3873A67
_computerlevel[18] attribute: profileUUID: D369D410-0E42-44CD-BBA5-C972C3873A67
_computerlevel[18] attribute: profileType: Configuration
_computerlevel[18] attribute: removalDisallowed: TRUE
_computerlevel[18] attribute: version: 1
_computerlevel[18] attribute: containsComputerItems: TRUE
_computerlevel[18] attribute: internaldata: TRUE
_computerlevel[19] attribute: name: Chromium Edge
_computerlevel[19] attribute: configurationDescription: 
_computerlevel[19] attribute: installationDate: 2020-03-16 16:09:27 +0000
_computerlevel[19] attribute: organization: CompanyName Worldwide
_computerlevel[19] attribute: profileIdentifier: 181BC800-F3E4-4760-BA33-515C938B5D6D
_computerlevel[19] attribute: profileUUID: 181BC800-F3E4-4760-BA33-515C938B5D6D
_computerlevel[19] attribute: profileType: Configuration
_computerlevel[19] attribute: removalDisallowed: TRUE
_computerlevel[19] attribute: version: 1
_computerlevel[19] attribute: containsComputerItems: TRUE
_computerlevel[19] attribute: internaldata: TRUE
_computerlevel[20] attribute: name: Privacy Preferences Policy Control
_computerlevel[20] attribute: configurationDescription: Profile for Jamf management framework
_computerlevel[20] attribute: installationDate: 2019-11-27 16:58:03 +0000
_computerlevel[20] attribute: organization: Jamf Software
_computerlevel[20] attribute: profileIdentifier: com.jamfsoftware.tcc.management
_computerlevel[20] attribute: profileUUID: com.jamfsoftware.tcc.management
_computerlevel[20] attribute: profileType: Configuration
_computerlevel[20] attribute: removalDisallowed: TRUE
_computerlevel[20] attribute: version: 1
_computerlevel[20] attribute: containsComputerItems: TRUE
_computerlevel[20] attribute: internaldata: TRUE
_computerlevel[21] attribute: name: Security and Privacy
_computerlevel[21] attribute: configurationDescription: 
_computerlevel[21] attribute: installationDate: 2019-11-27 16:57:41 +0000
_computerlevel[21] attribute: organization: CompanyName Worldwide
_computerlevel[21] attribute: profileIdentifier: A3AD439A-5E19-4A62-BC3A-F1820865D3A9
_computerlevel[21] attribute: profileUUID: A3AD439A-5E19-4A62-BC3A-F1820865D3A9
_computerlevel[21] attribute: profileType: Configuration
_computerlevel[21] attribute: removalDisallowed: TRUE
_computerlevel[21] attribute: version: 1
_computerlevel[21] attribute: containsComputerItems: TRUE
_computerlevel[21] attribute: internaldata: TRUE
_computerlevel[22] attribute: name: Enterprise Connect
_computerlevel[22] attribute: configurationDescription: 
_computerlevel[22] attribute: installationDate: 2019-11-27 16:57:38 +0000
_computerlevel[22] attribute: organization: CompanyName Worldwide
_computerlevel[22] attribute: profileIdentifier: 50273D5A-D5A8-489D-8909-AD9B1F79B9E7
_computerlevel[22] attribute: profileUUID: 50273D5A-D5A8-489D-8909-AD9B1F79B9E7
_computerlevel[22] attribute: profileType: Configuration
_computerlevel[22] attribute: removalDisallowed: TRUE
_computerlevel[22] attribute: version: 1
_computerlevel[22] attribute: containsComputerItems: TRUE
_computerlevel[22] attribute: internaldata: TRUE
_computerlevel[23] attribute: name: System Restrictions
_computerlevel[23] attribute: configurationDescription: Disables System Preferences options.
_computerlevel[23] attribute: installationDate: 2020-04-02 14:04:43 +0000
_computerlevel[23] attribute: organization: CompanyName Worldwide
_computerlevel[23] attribute: profileIdentifier: 35EA461C-9D98-40FA-A3E0-4CC297C9D601
_computerlevel[23] attribute: profileUUID: 35EA461C-9D98-40FA-A3E0-4CC297C9D601
_computerlevel[23] attribute: profileType: Configuration
_computerlevel[23] attribute: removalDisallowed: TRUE
_computerlevel[23] attribute: version: 1
_computerlevel[23] attribute: containsComputerItems: TRUE
_computerlevel[23] attribute: internaldata: TRUE
_computerlevel[24] attribute: name: CompanyName Email Signature Creator
_computerlevel[24] attribute: configurationDescription: 
_computerlevel[24] attribute: installationDate: 2019-11-27 16:57:52 +0000
_computerlevel[24] attribute: organization: CompanyName Worldwide
_computerlevel[24] attribute: profileIdentifier: 1da8b849-729a-4bb2-9fee-08886205a19b
_computerlevel[24] attribute: profileUUID: 1da8b849-729a-4bb2-9fee-08886205a19b
_computerlevel[24] attribute: profileType: com.apple.TCC.configuration-profile-policy
_computerlevel[24] attribute: removalDisallowed: TRUE
_computerlevel[24] attribute: version: 1
_computerlevel[24] attribute: containsComputerItems: TRUE
_computerlevel[24] attribute: internaldata: TRUE

1 Ответ

1 голос
/ 02 мая 2020

Я взглянул на ваш скрипт и переписал его так:

#! /bin/bash

## Configuration Profiles
profileList=( "Chromium Edge" "Privacy Preferences Policy Control" "Security and Privacy" "Enterprise Connect" "System Restrictions" "Chrome Whitelist" "Network Configuration 2.0" "Chrome Extensions" "MAU_AppArray2019" "Approved Kernel Extensions" "Bomgar" "Office ProPlus 365" "ATP" "Chromium Edge Allowlist" "ScreenSaver Settings" "Disable Chrome Auto-Updates" "ShowDocStageOnLaunch" "MAU_AppArray" "MDM Profile" "macOSLAPS" "Browser Homepage" "Microsoft Auto Update Production" "Office Preference Keys" )
missingProfiles=()

tmpfile=/tmp/$$.tmp
profiles -C -v | awk -F: '/attribute: name/{ gsub(/^ | +$/,"",$NF); print $NF}' > $tmpfile

for i in "${profileList[@]}"; do
    echo -n Checking profile: "$i"
    c=$( grep -c "$i" $tmpfile )
    if [ $c -gt 0 ];
    then
        echo " FOUND"
    else
        echo " NOT FOUND"
        missingProfiles+=( "$i" );
    fi
done
echo MISSINGPROFILES: $missingProfiles

Этот скрипт сначала соберет «имена профилей» в временном файле

И затем проверьте (grep -c), сколько раз профиль из $ profileList находится в этом tmpfile.

Создан временный файл, и в настоящее время я не удаляю его, но при желании вы можете добавить rm $tmpfile в конце этого сценария.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...