I was executing a command "who -ms" from a CHUI application but i get below message,
It seems that who command can be executed only when we are logged directly in unix box as we have terminal.
Is there a way to get rid of this problem , or anyother command where i can get machine name of the terminal from where i am logged in?
Moderator's Comments:
Please use next time code tags for your code and data
hostname gives servername whereas I am looking for localhost meaning for eg if i connect from any terminal to unix server , I would like to get the machine name which is used to connect and not the unix server name
What connection method are you using to connect to this computer. How are you running unix commands?
What Operating System and version are you running and what Shell do you use?
If you are connecting to a database engine, what it it?
Ps. We assume that CHUI means Character-based User Interface. Some sort of Shell breakout from your application?
I got another way of getting the user details ie using finger which gets me details in the application , but the problem is it gets details about all the session of the user who is logged in and not only for the current one
beliow is the command which i used , I dont think who command works if i am not in console . Somehow if we can get below commadn to work for currnet session using tty and $logname and get <logname>@<machine name from where we are logged in> , it will solve the purpose.
any idea
Last edited by vbe; 01-27-2012 at 01:54 PM..
Reason: code tags...
Hello i am having an issue with bash script and this is the code
now=$(cat hosts1.txt | awk '{print $2;}')
while read n ;do
ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers'
When i execute only part with cat, it... (8 Replies)
Hello,
I'm looking for some code that will list sequences of files as a single line.
ie, sequences of files like this:
filename.1.ext
filename.2.ext
filename.3.ext
filename.4.ext
filename.5.ext
filename.6.ext
filename.7.ext
filename.8.ext
filename.9.ext
filename.10.ext
would... (6 Replies)
Hello,
I have a PERL-TK based GUI from which I want to launch a command on an existing UNIX terminal (this is also the parent terminal for this perl based gui window). The command I want to launch is interactive (there is no intention to interact with that command from the same PERL gui i.e. no... (2 Replies)
Hello,
I am trying to learn how to pass something more than a one-command startup for gnome-terminal.
I will give an example of what I'm trying to do here:
#! /bin/bash
#
#TODO write this for gnome and xterm
USAGE="
______________________________________________
${0##*/}
run... (0 Replies)
Hi Group ,
I m trying to execute commands on some other system using write command but inspite of executing the commands they r passed as simple messages.
- i m writing
>write user-id
! ls
o
ctrl-d
inspite of executing the command ls,other terminal shows ! ls.
Thnx in advance. (2 Replies)
Any chance someone could look up the Whois for www.weddingchannel.la and www.art.la at the following link:
whois -h whois.afilias-grs.info domainname.la
Thanks in advance!!!
rdm (4 Replies)
I just changed from windows NT to XP and I am no longer able
to connect to my unix system. I used to use hyper terminal -- which acts as dumb terminal to my main frame unix system. I think one of the options used to be "direct to comX". This option isn't listed now. I use a serial port and the... (2 Replies)