pbpaste and grep with Mac X11

Hello,
Here is what I am trying to do:

1) Copy a string to the pasteboard using Command-C
2) Search for the string in a file in X11.

Command-C
pbaste | grep - filname (does NOT work)

What is the correct syntax?

Thanks!

Try:

grep -f <(pbpaste) filname
bash-3.2$ grep -f < (pbpaste) Product.txt
bash: syntax error near unexpected token `('
bash-3.2$ grep -f < pbpaste Product.txt 
bash: pbpaste: No such file or directory

It doesn't seem to work with or without parentheses.

There is no space between < and (

1 Like

That did it.. thanks so much!