Just use following command to get a variable with awk command: echo | awk -v myvar='AWK variable' '{print myvar}'