Sponsored Content
Full Discussion: Piping to grep with pbpaste
Operating Systems OS X (Apple) Piping to grep with pbpaste Post 303016931 by Don Cragun on Sunday 6th of May 2018 02:38:10 PM
Old 05-06-2018
Note also that on macOS, the grep utility only works on complete lines of text. If the text you selected does not include a <newline> character at the end of the line you selected, pbpaste will only output a partial line of output without a line terminating <newline> character.
This User Gave Thanks to Don Cragun For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

piping the output of find command to grep

Hi, I did not understand why the following did not work out as I expected: find . -name "pqp.txt" | grep -v "Permission" I thought I would be able to catch whichever paths containing my pqp.txt file without receiving the display of messages such as "find: cannot access... Permisson... (1 Reply)
Discussion started by: 435 Gavea
1 Replies

2. Shell Programming and Scripting

question about grep, cut, and piping

Howdy folks, I am fairly new to scripting but have lost of expirience in c++, pascal, and a few other. I am trying to complete a file search script that is sent a file name containing data to search that is arranged like this "id","name","rating" "1","bob","7" etc and an argument to... (1 Reply)
Discussion started by: dyrt
1 Replies

3. UNIX for Dummies Questions & Answers

Piping GREP

Hi, I need to use a double grep so to speak. I need to grep for a particular item say BOB and then for each successful result I need to grep for another item say SMITH. I tried grep "BOB" filename | grep "SMITH" but it does not seem to work. I can achieve my desired result using an... (12 Replies)
Discussion started by: mojoman
12 Replies

4. Shell Programming and Scripting

Piping STDOUT as pattern to grep or sed

$>cat file.txt 123 d3 234 abc 3 zyf 23 124 def 8 ghi kz0 ... ... I have the following output on the screen through <some command>. $> <some command> abc def ghi ... ... I have to search for each of these patterns in the file.txt and print the lines in file.txt matching the... (4 Replies)
Discussion started by: VNR
4 Replies

5. Ubuntu

Piping with grep

Hi everybody, I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form). I am trying to extract some ids from within this file, which have certain parameters. For example, some Of my IDs have the term 'No hit results'... (1 Reply)
Discussion started by: frymor
1 Replies

6. Ubuntu

Piping with grep

Hi everybody, I have a big file with blast results (if you know what this means, otherwise look at it just as a text file with a specific form). I am trying to extract some ids from within this file, which have certain parameters. For example, some Of my IDs have the term 'No hit results'... (6 Replies)
Discussion started by: frymor
6 Replies

7. Shell Programming and Scripting

piping from grep to awk without intermediate files

I am trying to extract the file names alone, for example "TVLI_STATS_NRT_XLSTWS03_20120215_132629.csv", from below output which was given by the grep. sam:/data/log: grep "C10_Subscribe.000|subscribe|newfile|" PDEWG511_TVLI_JOB_STATS.ksh.201202* Output: ... (6 Replies)
Discussion started by: siteregsam
6 Replies

8. Shell Programming and Scripting

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! (4 Replies)
Discussion started by: palex
4 Replies

9. UNIX for Dummies Questions & Answers

Piping grep into awk, read the next line using grep

Hi, I have a number of files containing the information below. """"" Fundallinfo 6.3950 14.9715 14.0482 """"" I would like to grep for Fundallinfo and use it to read the next line? I ideally would like to read the three numbers that follow in the next line and... (2 Replies)
Discussion started by: Paul Moghadam
2 Replies

10. Shell Programming and Scripting

Piping through grep/awk prevents file write

So, this is weird... I'm running this command: iotop -o -P -k -bt -d 5 I'd like to save the output relelvant to rsyslogd to a file, so I do this: iotop -o -P -k -bt -d 5 | grep rsyslogd >> /var/log/rsyslogd Nothing is written to the file! I can write the full output to the file: ... (2 Replies)
Discussion started by: treesloth
2 Replies
PBCOPY(1)						      General Commands Manual							 PBCOPY(1)

NAME
pbcopy, pbpaste - provide copying and pasting to the pasteboard (the Clipboard) from command line SYNOPSIS
pbcopy [-help] [-pboard {general | ruler | find | font}] pbpaste [-help] [-pboard {general | ruler | find | font}] [-Prefer {txt | rtf | ps}] DESCRIPTION
pbcopy takes the standard input and places it in the specified pasteboard. If no pasteboard is specified, the general pasteboard will be used by default. The input is placed in the pasteboard as plain text data unless it begins with the Encapsulated PostScript (EPS) file header or the Rich Text Format (RTF) file header, in which case it is placed in the pasteboard as one of those data types. pbpaste removes the data from the pasteboard and writes it to the standard output. It normally looks first for plain text data in the pasteboard and writes that to the standard output; if no plain text data is in the pasteboard it looks for Encapsulated PostScript; if no EPS is present it looks for Rich Text. If none of those types is present in the pasteboard, pbpaste produces no output. * Encoding: pbcopy and pbpaste use locale environment variables to determine the encoding to be used for input and output. For example, absent other locale settings, setting the environment variable LANG=en_US.UTF-8 will cause pbcopy and pbpaste to use UTF-8 for input and output. If an encoding cannot be determined from the locale, the standard C encoding will be used. Use of UTF-8 is recommended. Note that by default the Terminal application uses the UTF-8 encoding and automatically sets the appropriate locale environment variable. OPTIONS
-pboard {general | ruler | find | font} specifies which pasteboard to copy to or paste from. If no pasteboard is given, the general pasteboard will be used by default. -Prefer {txt | rtf | ps} tells pbpaste what type of data to look for in the pasteboard first. As stated above, pbpaste normally looks first for plain text data; however, by specifying -Prefer ps you can tell pbpaste to look first for Encapsulated PostScript. If you specify -Prefer rtf, pbpaste looks first for Rich Text format. In any case, pbpaste looks for the other formats if the preferred one is not found. The txt option replaces the deprecated ascii option, which continues to function as before. Both indicate a preference for plain text. SEE ALSO
ADC Reference Library: Cocoa > Interapplication Communication > Copying and Pasting Carbon > Interapplication Communication > Pasteboard Manager Programming Guide Carbon > Interapplication Communication > Pasteboard Manager Reference BUGS
There is no way to tell pbpaste to get only a specified data type. Apple Computer, Inc. January 12, 2005 PBCOPY(1)
All times are GMT -4. The time now is 01:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy