Functions in bashrc. Another simple thing

    In .bashrc you can describe functions.

    Why am I? If you are missing alias, it is not necessary to write a one-line script.

    You can add, for example, a function in .bashrc to get an external ip address. On the command line, wanip will show your external ip address. And it’s better to put it in a separate file, for this, add .bash_func to the .bashrc file name, where we will write the functions.

    wanip() {
    wget -q -O - checkip.dyndns.com | awk '{print $6}'| sed 's/<.*>//'
    }





    if [ -f ~/.bash_func ]; then
    . ~/.bash_func
    fi




    Also popular now: