awk select second field stored in a variable code example Example: awk select second field stored in a variable y=$(echo $x | awk '{print $2}') echo $y