Search Results

Search: Posts Made By: someone123
27,496
Posted By someone123
answer
omg, isn't there a simple way to do this?

how can i make awk recognize the second field as a pattern?

this doesn't work:
awk -v numbers="$numbers" '{if (numbers ~ /$2/) print $0, "bla bla"}'...
27,496
Posted By someone123
yep
forgot to mention - the line i wrote didn't work i guess it has to do with the syntax

and yes, what i meant to do was:
if the line contains one of the numbers (in the 2ed field), then print $0,...
27,496
Posted By someone123
how do i pattern match a field with awk?
hi,

let's say $numbers = "324 350 587" an so on...
what i'm trying to do is this:

awk -v numbers="$numbers" '{if (numbers ~ /$2/) print $0, "bla bla"}' file

# file looks like this:
214...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 01:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy