How to use a directory name with the logged in user in the script

Hi I have a small question.

I got a bit rusty in working with the mac command line.


I want to create a simple script. f.ex


every user has f.ex. a folder named Folder_To_Clean in his homedir.

rm -r /Users/Mac_User/Folder_To_Clean/*


now my question is how can I change this script so that I can run for every user after logging in? (and it should clear the Folder_To_Clean in his homedir


thought it was someting like this


rm -r /Users/%USER%/Folder_To_Clean/*

thanks alot

NESTi

MacBook Pro, OS X Yosemite (10.10.1), 17"

Posted on Sep 23, 2015 9:47 PM

Reply
4 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to use a directory name with the logged in user in the script

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.