Score:-1

Redirect file into stdin as an option of a command

it flag
RAN

I am running a command (tree_doctor) that has an option (--prune), which takes comma-separated list as input (e.g., A,B,C). I can get desired output with

tree_doctor --prune A,B,C --other_option

But I want to input the A,B,C from a file (list.ls) that contains A,B,C inside and I failed with:

tree_doctor --prune list.ls --other_option
tree_doctor --prune < list.ls --other_option
tree_doctor --prune <(cat list.ls) --other_option

Any suggestion?

Score:0
cn flag

It will work with the following syntax:

tree_doctor --prune "$(cat list.ls)" --other_option

list.ls contains the string 'A,B,C' for your example.

RAN avatar
it flag
RAN
That works very well. Thank you!
I sit in a Tesla and translated this thread with Ai:

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.