Работа с awk: различия между версиями

Материал из wiki.nntc.nnov.ru
Перейти к навигации Перейти к поиску
(Новая: cat ip-mac | awk -F " " '{ print $1 " " $4 }' | sed s/-/:/g > ip-mac-final cat list | awk ' { print "host" $2 "{\n\t hardware ethernet" $1";\n\t fixed-address " $2";\n}" } ')
 
Строка 2: Строка 2:
  
 
  cat list | awk ' { print "host" $2 "{\n\t hardware ethernet" $1";\n\t fixed-address " $2";\n}" } '
 
  cat list | awk ' { print "host" $2 "{\n\t hardware ethernet" $1";\n\t fixed-address " $2";\n}" } '
 +
 +
cat $1  | awk '{ print $2 " " $9 }' | awk -F "." '{ print "lab204-" $4" " $1"."$2"."$3"."$4 }' | awk ' { print "host " $1 "{\n" "\t hardware ethernet" $3 ";\n \t fixed adress" $2 ";\n }"  } '

Версия 11:42, 1 марта 2009

cat ip-mac | awk -F " "  '{ print $1 " " $4   }' | sed s/-/:/g > ip-mac-final
cat list | awk ' { print "host" $2 "{\n\t hardware ethernet" $1";\n\t fixed-address " $2";\n}" } '
cat $1  | awk '{ print $2 " " $9 }' | awk -F "." '{ print "lab204-" $4" " $1"."$2"."$3"."$4 }' | awk ' { print "host " $1 "{\n" "\t hardware ethernet" $3 ";\n \t fixed adress" $2 ";\n }"  } '