Access value from different server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Access value from different server
# 1  
Old 06-30-2009
Error Access value from different server

Hi

my problem goes like dis

i have two linux pc

i have configure in /etc/hosts file
Code:
192.168.50.1 avinash
192.168.50.2 pradeep

.......... in pc1
so that echo $avinash and echo $pradeep will display the ip specified above

but my actual problem
being in pc2 i know the variable names "avinash" and "pradeep"
from pc2 knowing the above variable i have to access the ip specified in /etc/hosts of pc1

Please help me...

Last edited by Yogesh Sawant; 06-30-2009 at 03:46 AM.. Reason: added code tags
# 2  
Old 07-01-2009

Code:
while read ip name junk_in_case_of_more_than_one_name
do
  eval "$name=\$ip"
done < /etc/hosts

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

2. Proxy Server

How to use Squid on Linux to control certain IP to access Web Server and certain IP cannot access?

Dear all experts here, :) I would like to install a proxy server on Linux server to perform solely to control the access of Web server. In this case, some of my vendor asked me to try Squid and I have installed it onto my Linux server. I would like know how can I set the configuration to... (1 Reply)
Discussion started by: kwliew999
1 Replies

3. Shell Programming and Scripting

Multi server access through remote server using ssh

Team, Presently I have 5 ip address kept in ip_abc1 file, for each of the ip address listed, i need to login on each ipaddress one at a time and login as below for that specific ip address ssh -p 8101 karaf@<ip.address_for the specific ip address as logged in> password features:list... (4 Replies)
Discussion started by: whizkidash
4 Replies

4. UNIX for Dummies Questions & Answers

Access of Microsoft Team Foundation Server (TFS) repository from Unix Server

Hello, Some of our application team uses Microsoft Team Foundation server (TFS) reposity tool for their .NET projects , I would like to access it form Unix/Linux machine. Please let me know how can access the TFS from unix. Thanks (0 Replies)
Discussion started by: posix
0 Replies

5. UNIX for Dummies Questions & Answers

server is up but cannot access through ssh

server is at remote site; server is up. I can access it through console. but I cannot access it through ssh. I have restarted SSH already and even do ifconfig ce0 down and up still not successful ... any comment? (2 Replies)
Discussion started by: uuontario
2 Replies

6. Web Development

access to my server is always allowed

Hi, I can't deny the access to my server. if I visit http://localhost I can always see all the files. Why ? <Directory /> Options FollowSymLinks AllowOverride None Order allow,deny Deny from All </Directory> <Directory "/Users/aneuryzma/Sites"> (4 Replies)
Discussion started by: aneuryzma
4 Replies

7. Shell Programming and Scripting

Can a script runned in local server access remote server?

Hi, Im creating a script that is supposed to run commands on remote server using sftp. My script is as below: #!/bin/ksh sftp remote_server mypassword cd /u08/mydir/allfiles mget * .. But this is what I got when I runned the script: Connecting to remote server...... (3 Replies)
Discussion started by: luna_soleil
3 Replies

8. Shell Programming and Scripting

remote server access

hi everybody, im kinda a new to scripting.... i have attached an image in this post... my goal is to extract data from the remote servers (server1,2,3 as in figure) to the server residing locally.... the criterias are: * I should not pass the password across the remote servers. *... (1 Reply)
Discussion started by: mercuryshipzz
1 Replies

9. UNIX for Advanced & Expert Users

Is it possible to access from a server the database of another server.

Hi, I am using Teamcenter & in unix have ftpd the IMAN_DATA(unix) of the other server to this server & set all the environment variables(like ORACLE_HOME, IMAN_DATA) correctly.I have created a link that points to this path where i had ftpd the IMAN_DATA(unix).In IMAN_DATA which i had ftpd all... (1 Reply)
Discussion started by: debu
1 Replies

10. UNIX for Advanced & Expert Users

I access to my server via Telnet

I use server Unix with AIX 5.2. I can't telnet to server about 5 mn, then i can access to server via telnet. This problem have again and again. Sometime can, sometime can't. I dont know why? Do you have any idea? (4 Replies)
Discussion started by: SENG
4 Replies
Login or Register to Ask a Question