04-24-2018
It works for me, if the while loop reads from a text file.
What is pbpaste?
How does your input file look like? Is it Unix style? (where newline is LF, also the last line ends with LF, as opposed to DOS style where newline is CR LF and the last line has no newline)
10 More Discussions You Might Find Interesting
1. AIX
Hi,
I am new to AIX and I am developing a small tool for our product which helps debug memory leaks etc.
Q1)Is there a way in which i can get a function trace back as to the call (lets say malloc() )has been made in which file--> in which function.
I tried using the
#pragma options (... (0 Replies)
Discussion started by: Wkdunreal
0 Replies
2. Shell Programming and Scripting
I have this code, I thought it would automatically know the args sent to script when called from shell. But it seems to not see any...
main script:
. args
. errors
. opt
. clean
dbfile=""
opfile=""
# calls function in script below
chkarg
#check commands (2 Replies)
Discussion started by: gcampton
2 Replies
3. Homework & Coursework Questions
I have no idea what the following means. The teacher is too advanced for me to understand fully. We literally went from running a few commands over the last few months to starting shell scripting. I am not a programmer, I am more hardware oriented. I wish I knew what this question was asking... (3 Replies)
Discussion started by: Wookard
3 Replies
4. Shell Programming and Scripting
I need help with debugging an error in my awk script.
I have a shell script with variable named U_new_i and want to pass it to awk for use in a summation. The original file have the following content.
cat test.txt
-2445.7132000000
-2444.9349000000
-2444.3295000000
-2443.1814000000 ... (0 Replies)
Discussion started by: Quantum_Dot
0 Replies
5. Shell Programming and Scripting
I have a text file with file names, id like to have this portion of my BASH script go grab the line (which in this case is the full path to my file) then cat that file so I could pipe it to a email.
1) My text file (/tmp/1.txt) is setup like this:
... (3 Replies)
Discussion started by: binary-ninja
3 Replies
6. Programming
Here is the program I am trying to debug:
#include <stdio.h>
int i = 5;
int main(void)
{
int x = 3;
display(x);
return 0;
}
void display(int x)
{
for ( i=0; i<x; ++i ) {
printf("i is %d.\n", i);
}
}This code is coming from here Peter's gdb Tutorial: Stepping... (2 Replies)
Discussion started by: ijustneeda
2 Replies
7. Shell Programming and Scripting
I am new to shell scripting and wished to get few things clarified.
While calling functions within shell script, output comes out as single line irrespective of the no of echos or newlines I tried within function +
the echo -e used to invoke function ( as instructed online) :
#!/bin/sh
inc() {... (1 Reply)
Discussion started by: RMath
1 Replies
8. How to Post in the The UNIX and Linux Forums
I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command - grep -l 'RITE AID.*ST.820' natriter820u.20140914
Pattern1 - RITE AID
Pattern2 - ST*820
I am not getting any results from this,... (3 Replies)
Discussion started by: Raghav Garg
3 Replies
9. UNIX for Dummies Questions & Answers
Hello
I am using a grep command with two patterns in my KSH script. File has line breaks in it and both the patterns are in different lines. Here is the command grep -l 'RITE AID.*ST.820' natriter820u.20140914
Pattern1 - RITE AID
Pattern2 - ST*820
I am not getting any results from... (24 Replies)
Discussion started by: Raghav Garg
24 Replies
10. UNIX for Beginners Questions & Answers
I am looking at a log file which just tells me the filename and the line number inside that file that has the Error. What I am interested is knowing the encapsulating function. For example, here are the contents of the log file
Error: foo.file on line wxy
Error: foo.file... (3 Replies)
Discussion started by: kaaliakahn
3 Replies
LEARN ABOUT MOJAVE
pbpaste
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)