0

I want to achieve the two following things:

  1. Every time I create a new directory X in the directory Y the same directory X should be created in another directory Z automatically.

  2. Every time the duplicated folder gets created in directory Z, in it a new .py document with the same name should be created. The first line of the .py document should also state the absolute path of directory X.

How would I go about that? I am on a mac. So I assume I would write some lines of code into my bash profile, so that every time I create a the new directory X in the directory Y with "mkdir" this chain of events gets triggered? Is that a good start?

Jailbone
  • 167
  • 1
  • 9
  • you need fswatch, please check this post https://stackoverflow.com/questions/1515730/is-there-a-command-like-watch-or-inotifywait-on-the-mac – al3x2ndru Feb 01 '21 at 06:50

1 Answers1

0

If you create a bash script, using commands but not limited to the following, mkdir cp touch chmod chown while checking the file permissions, and afterwards the group and user as well. You can then run the script instead of manually performing these actions.

Shaqil Ismail
  • 1,794
  • 1
  • 4
  • 5