Need script help removing fonts

NealIV
Contributor

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
1 ACCEPTED SOLUTION

tthurman
Contributor III

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.

View solution in original post

2 REPLIES 2

tthurman
Contributor III

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.

NealIV
Contributor

Thanks!