Create Script to run as current user and store on Users Desktop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
09-18-2019
11:53 AM
- last edited
3 weeks ago
by
kh-richa_mig
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:
!/bin/bash
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
