Variable directory name in path

I need to write a login script for multiple computers, however, one of the directories in question will have a different name from computer to computer.

~/Library/Application\ Support/Firefox/Profiles/<unique filename>.default/myfile

For the directory named <unique filename>.default , I need to figure out how to get a wildcard going or set a variable so that I can create a file in a directory below it. All computers will have the .default extension on that directory, but different strings will preceed the dot. I imagine I can do a grep with a wildcard and then set a variable based on the results, but if that is the easiest way, I still would need help to accomplish it. Thanks for your time!

Is there any relationship between any of the information you have and the unique directory name (ud for short)? For instance, based on node name and user id? Is there
any expectation of any other directory having the name ud.default in the parent directory?
If not, then maybe u can use *. That will depend on where and what command is executed.

Going to need all the normal info for anyone to help..

  1. What are the environmentals (os, shell, etc)
  2. What is the big picture of the problem.
  3. Is the script expected to run on one machine or several?
  4. What are you grep'ing to get the info?

I'm not sure that I have correctly understood your problem. To have different dir names for different users you may variable, e.g.

~/Library/Application\ Support/Firefox/Profiles/${NAME_OF_YOUR_VARIABLE}.default/myfile