Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

love Cal, call a script to use it in my .bashrc to show current date, user, day/time, logins and filesystem status.

    clear
    cal
    echo "Hey \033[1m$USER\033[0m it's \033[1m`date '+%A %d %B @ %T'`\033[0m" | 
          tr '[A-Z]' '[a-z]' 
    echo "logins:\c" ; who | wc -l
    df -h


Note that output from .bashrc stuffs up rsync and scp, in case you use them.

Enclose the lot in { .... } >&2

to send output to stderr instead.

Or only output if the session is interactive, with isatty or if PS1 is set or $- contains 'i'.


"Note that output from .bashrc stuffs up rsync and scp, in case you use them. Enclose the lot in { .... } >&2"

I call a shell script from my .bashrc so does this have the same effect? I'll take this advice and wrap the script. I don't use scp or rsync but possible could at some time, thanks @emmelaich.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: