Skip to main content
added 17 characters in body
Source Link
Black
  • 125
  • 1
  • 2
  • 12

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern'

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern' | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values again (2nd time) as patterns after grep command in pipeline with the above one?

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern'

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern' | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values as patterns after grep command in pipeline with the above one?

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern'

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern' | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values again (2nd time) as patterns after grep command in pipeline with the above one?

added 2 characters in body
Source Link
Black
  • 125
  • 1
  • 2
  • 12

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern'pattern'

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern'pattern' | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values as patterns after grep command in pipeline with the above one?

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values as patterns after grep command in pipeline with the above one?

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern'

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern' | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values as patterns after grep command in pipeline with the above one?

added 518 characters in body
Source Link
Black
  • 125
  • 1
  • 2
  • 12

Suppose I have used awk to get the value of two different columns:

For example:

cat 'filename' | awk '{ print $1,"\t" $3 }'

Say the output of the above command is:

abc    def

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

catpdftotext 'filename''filename.pdf' - | grep 'pattern

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern | awk '{ print $1,"\t" $3"\t"$2 }'

Is there any way to do thisNow how will I pass these two values as patterns after grep command in pipeline with the above one?

Suppose I have used awk to get the value of different columns:

For example:

cat 'filename' | awk '{ print $1,"\t" $3 }'

Say the output of the above command is:

abc    def

Now, I want to use both abc and def as patterns for grep, using a pipeline with

cat 'filename' | awk '{ print $1,"\t" $3 }'

Is there any way to do this?

Suppose I have used awk to get the value of two different columns:

Say the output is:

abc

def

Now, I want to use both abc and def as patterns for grep, using a pipeline with the previous command. Is there any way to do this?

For more clarification:

I have a pdf file and I am searching for a keyword the file using :

pdftotext 'filename.pdf' - | grep 'pattern

Now if any match is found, I want to use the first and second column of the result as parameters for grep in pipeline with the previous command. I can get the first two columns using

pdftotext 'filename.pdf' - | grep 'pattern | awk '{ print $1, "\t"$2 }'

Now how will I pass these two values as patterns after grep command in pipeline with the above one?

FIxed punctuation
Source Link
terdon
  • 252.3k
  • 69
  • 480
  • 718
Loading
added 96 characters in body
Source Link
Black
  • 125
  • 1
  • 2
  • 12
Loading
Source Link
Black
  • 125
  • 1
  • 2
  • 12
Loading