Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • You don't do it like that: awk has a command line option for passing variables - see Use a script parameter in awk Commented Apr 7, 2016 at 13:26
  • 1
    Please edit your question and show us an example of your input and your desired output. The main issue is that $j is not expanded in the awk script but we could give a better solution if you explain what you are trying to do. This sort of thing is rarely a good match for bash . Commented Apr 7, 2016 at 13:30