Get folder containing automator script
I have an Automator script that calls a shell script (bash) to do its work. How can my shell script learn the folder pathname that contains the Automator script/app that invokes it?
In particular, I want the Automator script to create a folder in the same directory as the script, with the new folder's name being today's date in YYYY-MM-DD format. Doing this through a shell script is not a requirement, but I'm a Unix programmer, and don't have AppleScript skills.
MacBook Pro 17", macOS 10.13