Skip to content
Advertisement

How To Substitute Piped Output of Awk Command With Variable

I’m trying to take a column and pipe it through an echo command. If possible, I would like to keep it in one line or do this as efficiently as possible. While researching, I found that I have to use single quotes to expand the variable and to escape the double quotes.

Here’s what I was trying:

JavaScript

But, I keep getting the number of lines than the single line’s output. If you know how to caputure each line in field 4, that would be so helpful.

File1.txt:

JavaScript

Desired output:

JavaScript

Advertisement

Answer

JavaScript

Or slightly briefer but less robustly:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement