Skip to main content

I have a script below that enables me to remove .ttf and .otf fonts from the users directory. It runs fine but when I look at the logs in the jss it doesnt tell me what it removed only that it completed. How can I put something in this script that tells me which fonts it removed?



#!/bin/sh

find /Users/ -type f -name "*.ttf" -exec rm -f {} ;
find /Users/ -type f -name "*.otf" -exec rm -f {} ;

exit 0

Are you removing all the fonts?



If not, you could do something like this:



#!/bin/sh

ttfFonts=$(find /Users/ -type f -name "*.ttf")
otfFonts=$(find /Users/ -type f -name "*.otf")

echo "$ttfFonts"
echo "$otfFonts"


Then do your removal.


Thanks!