Open main menu

CDOT Wiki β

Changes

OPS235 Lab 5 - CentOS7

20 bytes removed, 09:45, 4 May 2015
no edit summary
{|width="40%" align="right" cellpadding="10"
|- valign="top"
|{{Admon/tip|Bash Shell Scripting Tips:|<br><ul><li>'''Using awk to Manipulate Text:'''<br><br>Legend has it that the '''awk''' command was invented by three C programmers that wanted to create a utility in Unix that had programming syntax more like C programming (awk stands for the first letter in each person's name). People started to use the command and found it very useful for report generation and file repair or manipulation.<br><br>The command mimics a C program, with braces '''{ }''' that surround the action to perform based on records from a database file matching either test conditions, regular expressions, etc. Fields numbers appear surprisingly similar to positional parameters (eg. $1, $2, ... etc).<br><br>'''<u>Examples</u>:'''<br><br>''awk '{print}' data-file.txt''<br><br>'''<br><br>''awk -F";" '{print $5,$3}' data-file.txt''<br><br>''awk -F"," '$4 &gt;&#61; 10000 {print $1, $2}' employee-incomesalary.txt''</li></ul>}}
|}
13,420
edits