Sorry my knowledge of Linux bash commands is pretty basic, I've been searching for a while but I'm not 100% sure what I need to search for.
I was wondering if there's a way to grab the current logged in users remote host name in a Linux bash script? I have a script in which I need to log each time a user runs it. I'm obtaining the date like so:
cdat=`/bin/date +%a' '%d' '%h' '%Y', '%H':'%M`;
I now need to add the users remote host (not the username they logged in with). I'm not 100% sure I'm using the right terminology here either, just to clarify; by 'remote host name' I mean the same output that prints on the screen on most servers I've logged into over ssh, for example:
Last login: Mon Jul 22 16:35:09 2013 from win7-i7-stuart.my.domain.com
I'm looking for the