LINUXOPOLIS # 24-JANUARY-2020 ~ AWK v2

in #linux6 years ago (edited)

AWK

Building a Linux Habitat
willi glenz @ telegram
Published with SteemPeak
home previous

screenshot by willi glenz

$ vim ~/.config/fish/functions/gawk.fish

function gawk --description 'awk'
    clear; echo
    echo '=========================================================================='
    echo '                                   AWK                                    '
    echo '=========================================================================='
    echo ' # apt install gawk gawk-doc                                              '
    echo ' $ dpkg -L gawk-doc | less                                                '
    echo ' > file:///usr/share/doc/gawk-doc/gawk.pdf                                '
    echo '--------------------------------------------------------------------------'
    echo ' documentation                      gnu.org/software/gawk/manual/gawk.html'
    echo ' tutorial I                               tutorialspoint.com/awk/index.htm'
    echo ' tutorial II                             tldp.org/LDP/abs/html/sedawk.html'
    echo '=========================================================================='
    read

    clear; echo; echo 'MEMORY                                                       '
    read; free -h | awk '/^Mem:/ {print "free " $4 " used " $3 " total " $2}' | vim -

    clear; echo; echo 'TEMPERATURE                                                  '
    read; sensors | awk '/^Core|temp1/ {print $0}' | vim -

    clear; echo; echo 'USER I                                                       '
    read; awk -F: '{ print $1 }' /etc/passwd | sort | vim -

    clear; echo; echo 'USER II                                                      '
    read; awk -F: '/root|user1/ { print $0 }' /etc/passwd | vim -

    clear; echo; echo 'ENVIRONENT                                                   '
    read; printenv | awk '/PATH|HOME|USER|SHELL/ {print $0}' | vim -
end
SOURCES
 gnu.org ....................................  gnu.org/software/gawk/manual/gawk.html
 tldp ............................................. tldp.org/LDP/abs/html/sedawk.html
 tutorialspoint .................................... tutorialspoint.com/awk/index.htm
 picture ....................................... screenshoot by me ~ my gnome-desktop