79415326

Date: 2025-02-05 15:47:06
Score: 0.5
Natty:
Report link

I needed to do something a bit more complex (such as chaining basename and dirname), and solved it by calling bash on each filename, then using Bash subshells:

find "$all_locks" -mindepth 1 -maxdepth 1 -type d -exec bash -c 'basename $(dirname {})' \;

This solution allows using {} multiple times, which is handy for more complex cases.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: GreatEmerald