BASH ULTIMATE MAN PAGE
====================================================================================
#!/bin/bash
Beginning a bash script
====================================================================================
echo 'enter domain name to test'
read domain
Set user input as a variable
====================================================================================
GREP
-----------------------------------------------------------------------------------------------------------------------------------------------
====================================================================================
ECHO
echo -e
allow interpretation of backslash-escaped character:
\a alert (bell)
\b backspace
\c suppress further output
\e escape character
\E escape character
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab
\\ backslash
\0nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
\xHH the eight-bit character whose value is HH (hexadecimal). HH
can be one or two hex digits
\uHHHH the Unicode character whose value is the hexadecimal value HHHH.
HHHH can be one to four hex digits.
\UHHHHHHHH the Unicode character whose value is the hexadecimal value
HHHHHHHH. HHHHHHHH can be one to eight hex digits.
-----------------------------------------------------------------------------------------------------------------------------------------------
echo "${x%Y}"
Remove a character (Y) from a string
====================================================================================
SORT
sort -k1
Sort a file or output by a specific column, ie sort -k1 would sort by the first column
------------------------------------------------------------------------------------------------------------------------------------------------
sort -n
Numeric sort (default sort order is ascending).
-----------------------------------------------------------------------------------------------------------------------------------------------
sort -r
Reverse the output of the sort.
====================================================================================
AWK
awk '{print $1,$2}'
Print the first and second column
------------------------------------------------------------------------------------------------------------------------------------------------