pbpaste and grep with Mac X11


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting pbpaste and grep with Mac X11
# 1  
Old 06-13-2012
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!
# 2  
Old 06-13-2012
Try:
Code:
grep -f <(pbpaste) filname

# 3  
Old 06-13-2012
Code:
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.
# 4  
Old 06-13-2012
There is no space between < and (
This User Gave Thanks to Scott For This Post:
# 5  
Old 06-13-2012
That did it.. thanks so much!
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. OS X (Apple)

Piping to grep with pbpaste

cat file 1 aaa 2 bbb 3 ccc 4 ddd In TextEdit, I then copy the characters “ccc” to the clipboard. The problem is that the following command gives no output: bash-3.2$ pbpaste | grep - file Desired output: 3 ccc What should the syntax be for that command? I am using MacOS El... (3 Replies)
Discussion started by: palex
3 Replies

2. Shell Programming and Scripting

Grep not working on mac

Hi all, I got a new mac and can't get grep, awk etc to work. I tried the following command: grep DICER test.txt output: AGOER text.txt looks like this: DICER DICER AGOWhat is wrong? Please use code tags (23 Replies)
Discussion started by: Palgrave
23 Replies

3. Shell Programming and Scripting

GREP mac address

Hi, mac.txt My mac address is <Mac Address>. How can i replace <Mac Address> with the actual of my computer? I try to GREP command as below but i am unable to grep it to replace just <Mac Address>. ifconfig eth0 | grep -o -E '(]{1,2}:){5}]{1,2}' Million in Advance. Please use... (7 Replies)
Discussion started by: derrickyee81
7 Replies

4. UNIX for Dummies Questions & Answers

pbpaste to application in terminal

Is it possible to execute a pbpaste command to an application or current application in focus? Thanks (0 Replies)
Discussion started by: fhill2
0 Replies

5. UNIX for Advanced & Expert Users

[Solved] putty+x11:How do I pass X11 display rights to "su"?

I can log into a unix system with Putty. I've set the "X11 forwarding" checkbox, and I've verified that I can display an X11 window back on my laptop. What I need to be able to do is "su" to another uid after logging in and then run something which display a window back on my laptop, with the... (2 Replies)
Discussion started by: dkarr
2 Replies

6. OS X (Apple)

pbpaste

Hello, When I paste the contents of the clipboard to the command line via pbpaste, there is also a carriage return implicitly pasted (i.e. whatever gets pasted is automatically sent as a command). Is there a way to use pbpaste without this feature, so I can edit the text before sending the... (6 Replies)
Discussion started by: palex
6 Replies

7. UNIX Desktop Questions & Answers

X11 Display Problem with Mac OSX after creating new account

For preliminaries, I am on a Mac Pro running 10.5. I am trying to run a program that opens an X11 graphic and plots a mesh. The little program is called showme. It has worked just fine in the past. Up until I had to make a new user account on this machine for myself. Now every time I try to... (8 Replies)
Discussion started by: Bocephus85
8 Replies

8. Windows & DOS: Issues & Discussions

cygwin-x/can't install xorg-x11-f100 & xorg-x11-fnts

Hello All. Really a newbie to Linux/Unix. Trying to get into Linux. Using XP PE currently. Installed cygwin and trying to intall cygwin-x. Everything else is setup nice but i can't seem to install these two packages (without whom xwin won't start) 1. xorg-x11-f100 2. xorg-x11-fnts Tried the... (1 Reply)
Discussion started by: binodbdrchand
1 Replies
Login or Register to Ask a Question