Posted on 09-18-2019 11:53 AM
I've researched these forums and tried to adjust a script to my needs but still getting an error when running it.
Main Goal: To get a savable list of 32-bit applications to the users desktop.
CURRENT SCRIPT:
sudo system_profiler SPApplicationsDataType | grep -B 6 -A 2 "(Intel): No" > /Users/$USER/Downloads/32BitApps.txt
I've tried setting $USER as a custom variable as well, same result. (syntax was username = $USER)
Any information would be appreciated. I'm somewhat new to shell scripting so if possible, so please take that into consideration.
Posted on 09-18-2019 06:25 PM
Try this... Also JAMF runs as root so the sudo shouldn't be needed.
!/bin/bash
loggedInUser=$(ls -l /dev/console | awk '{ print $3 }')
system_profiler SPApplicationsDataType | grep -B 6 -A 2 "(Intel): No" > /Users/$loggedInUser/Desktop/32BitApps.txt