In a Bash script:#!/usr/bin/bash#grep()#{#grep -q#}if [[ -z $1 ]];then  echo usage: pkill -signal process name fiif [[ -z $2 ]];then  echo error: not enough parameters   exitfi    kill9=9kill15=15if [ $1 -eq $kill9 ]then  set 9 else  set 15fiARRAY=(  `ps -ef|grep $2 |grep -v grep|awk '{print \$2}'`)pkill(){  PIDTODIE=${2}  for i in ${ARRAY[@]} ;do kill $1  $i;done}pkill $1 $2 Is it possible to assign in awk, $2 so that it becomes $b? Because $2 is a Bash parameter and gives me conflicts. Also the \$2 is not working.
awk how to set parameter $2 become $b?
awk
You can set variables in awk from the shell like so:$ somevar=4$ echo | awk -v my_var=$somevar '{print My var is  my_var}'My var is 4ReferencesCan we use shell variables in awk?