Open main menu

CDOT Wiki β

Changes

OPS235 Lab 5 - CentOS7

70 bytes added, 10:40, 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 -F";" 'print {$5, $3}' data-file.txt''<br><br>''awk -F"," '$4 >= 10000 print {$5, $3}' employee-income.txt''</li></ul>}}
|}
13,420
edits