Subject: Re: bug#8500: util: where am i

From: Erik Auerswald <[email-masked]>
Date: Fri, 15 Apr 2011 13:01:42 +0200

Hi,

please don't top post, thanks. And keep on reading for inline comments. ;-)

On 04/15/2011 09:33 AM, Panagiotis Tsiamis wrote:
> 2011/4/15 Bjartur Thorlacius<[email-masked]>
>> On 4/14/11, Panagiotis Tsiamis<[email-masked]>  wrote:
>>> Request for adding one more feature on the utillity whoami.
>>>
>>> The feature should be able to called by
>>> "where am i" or "whereami"
>>>
>>> And should locate:
>>> a) System hostname

hostname
uname -n

>>> b) ip of the system

Bob had an excellent example:
ip addr | awk '/inet/{print $2}'

Of course this might be local and private addresses, not the IP address 
used for your internet connection.

>>> c) current working directory

pwd

>>> d) anything else that could be usefull for identify where you are located
>>> currently.

Most GNU/Linux distributions configure the shell prompt to display the 
usually helpful info, i.e. user name, host name, current working 
directory. Some people use color (or even blinking) to highlight working 
as a privileged user (root).

>> I doubt that should be included in coreutils. I could see the utility
>> of such an utility, and think packagers of SSH servers could well
>> suggest it, but I can more easily imagine a number of installations
>> where `hostname;pwd` would be as good, if not better.

Most shell configurations provide this info all the time.

> I don't dissagree about your opinion that involves ssh utillity to do this
> job (it could possibly also keep a look of systems that you recently connect
> also)
> but together with ssh there also are rsh/rlogin, telnet,  and other remote
> connection software that can be used from cli.

You can use 'who', 'w', 'last', 'pinky' or 'finger' to find out from 
where you (and others) are connected (and some additional info as well).

> I discuss the possibillity to
> integrate such a command that keeps tracks of recent systems, current
> system, system connection path (hostA->hostB->hostC) and distribute this
> information accordingly to each system you connect/disconnect. If anyone has
> furthermore ideas or is interested on a tool like this, hope will reply.

This kind of tracking functionality should be strictly opt-in.

All in all I don't see a need for a 'whereami' utility at all.

Regards,
Erik