I have a file which contain following lines:
/logs/tc0001/tomcat/tomcat7.1/conf/catalina.properties:app.env.server.name = demo.example.com
/logs/tc0001/tomcat/tomcat7.2/conf/catalina.properties:app.env.server.name = quest.example.com
/logs/tc0001/tomcat/tomcat7.5/conf/catalina.properties:app.env.server.name = www.example.com
In above output I want to extract 3 fields (Number 2, 4 and the last one *.example.com
). I am getting the following output:
cat file | awk -F'/' '{print $3 "" $5}'
tc0001 tomcat7.1
tc0001 tomcat7.2
tc0001 tomcat7.5
How do I also extract last field with domain name which is after '='
? How do I use multiple delimiter
to extract field?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…