Score:0

find -f results in unknown predicate in ubuntu, but works in macOS

uz flag

I'm attempting to set an environment variable with the following script. find -f ./node_modules/@marcom/*/src/scss -type d -d 0 | tr $'\n' :

This exact script works fine in macOS, however when I push to a remote server running ubuntu and attempt to run the same script, I get the result:

find: unknown predicate '-f'

I wasn't aware that find worked differently across OS variants, any pointers here would be greatly appreciated. Thanks in advance.

sudodus avatar
jp flag
If you have a working MacOS system, please check in `man find` what is the meaning of `-f` and tell us. Then we can tell you the corresponding expression in Linux. Otherwise you must wait for someone who knows `find` both in MacOS and Linux.
uz flag
-f specifies the file hierarchy for find to traverse.
sudodus avatar
jp flag
Thanks! Then you can simply remove it. The first parameter (if any) should be file hierarchy for find to traverse, so maybe `find /node_modules/@marcom/*/src/scss -type d -d 0 | tr $'\n' :` will do what you want. But I think you should also check the MacOS meaning of `-d` (I don't think it is the Linux '-depth`).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.