How do you use two shell variables in awk? I am using Solaris 10 and don't have GNU products installed.
File (transportation.txt) contents:
car make
boat model
airplane landing
snowmobile track
bicycle helmet
sled housing
Thanks to this forum this code works (prints everything from the contents of $vehicle to bicycle):
nawk -v v="$vehicle" 'match( $0, v ),/bicycle/' transportation.txt
But how do I replace bicycle with another variable? For arguments sake call it $vechicle2.
Also, will the above nawk code work with a string? For example if the contents of $vechicle equals boat model