Skip to main content
Answer

Need script help removing fonts

  • January 16, 2017
  • 2 replies
  • 9 views

Forum|alt.badge.img+11

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

Best answer by tthurman

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.

2 replies

Forum|alt.badge.img+14
  • Valued Contributor
  • Answer
  • January 16, 2017

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.


Forum|alt.badge.img+11
  • Author
  • Contributor
  • January 16, 2017

Thanks!