把shell变量传给awk

awk -F : -v user=”$u” ‘{if ($1==user) print $6}’ /etc/passwd

参考:http://www.gnu.org/…/Using-Shell-Variables.html

0 Responses to “把shell变量传给awk”


  • No Comments

Leave a Reply




This work by wolfg is licensed under a Attribution-Noncommercial-Share Alike 2.5 China Mainland.