Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Passing of variable values to remote server Post 302590240 by sree143reddy on Sunday 15th of January 2012 03:18:18 AM
Old 01-15-2012
Passing of variable values to remote server

Hi,
My script will take 3 i/p's from user. Now i need to pass these 3 values to remote server. Please find my code.

Code:
 
while [ 1 ]
do
   echo " To which server you want to connect ? "
   echo " 1. server1 \n"
   echo " 2. server2 \n"
   read opt_server
   if [ $opt_server -eq 1 ]
   then
      echo "enter the file which you want to FTP "
      read $1
      echo " enter into which path you want to FTP the file"
      echo " 1. Path1 \n "
      echo " 2. Path2 \n "
      read $2
      ksh remote_server.ksh $1 $2 
   else
      echo " you din't choose correct option "
      exit
   fi
done

with this code i am not able to pass the values which i am reading from user to the remote_server.ksh, with which i can FTP the required file.

Please help me in this regard.
Thanks in advance.

Thanks,
sreekanth.

Moderator's Comments:
Mod Comment Use code tags please, ty. Indention is also very helpful.

Last edited by zaxxon; 01-15-2012 at 04:49 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

passing variable values to awk command

Hi, I have a situation where I have to specify a different value to an awk command, I beleive i have the gist of this done, however I am not able to get this correct. Here is what I have so far echo $id 065859555 This value occurs in a "pipe" delimited file in postition 8. Hence I would... (1 Reply)
Discussion started by: jerardfjay
1 Replies

2. Shell Programming and Scripting

Passing the variable value to remote server.

Dear All, Can anybody explain me how to pass the variable value to command argument which will execute in remote machine. example.. test="test-123.dbf" how can i pass this value to command ls -l for remote machine? I tried to do like this way ssh root@remote 'ls -l... (2 Replies)
Discussion started by: nmadhuhb
2 Replies

3. Programming

SFTP from one remote server to another remote server from desktop

Hi, I have 1. lappy 2. server A 3. server B Now, what i need is to run a command from lappy that will sftp a file from server A to server B. Please guide me to achieve this. -akash (1 Reply)
Discussion started by: akash.mahakode
1 Replies

4. Shell Programming and Scripting

Passing Values to remote server

I'm trying to pass there values from the present server to the remote server. here is the below code. function abc() { export a=$1 export b=$2 export c="$3" export d="$4" #servers Servers=$(echo server40{1..3}p.s.com) for host in ${Servers}; do #server login ssh $host... (4 Replies)
Discussion started by: Amutha
4 Replies

5. Shell Programming and Scripting

Creating a variable in remote server

Can anyone help how to create a variable in remote server using shell script. i am connecting to remote server through ssh and creating a variable and assigning the value, but nothing is displayed when i run the script Here is my script ssh hostname <<EOF a=10 echo $a EOF (1 Reply)
Discussion started by: Rahul12341984
1 Replies

6. Shell Programming and Scripting

Passing values from awk to shell variable

I am writing a script where I need awk to test if two columns are the same and shell to do something if they are or are not. Here is the code I'm working with: @ test = 0 ... test = `awk '{if($1!=$2) print 1; else print 0}' time_test.tmp` #time_test.tmp holds two values separated by a space... (3 Replies)
Discussion started by: Malavin
3 Replies

7. Shell Programming and Scripting

Passing multiple column values to UNIX variable

sqlplus -s $USER_ID@$SID/$PWD<<EOF>sql_1.txt set feedback off set heading off select 114032 as c_1 from dual ; EOF for i in `cat sql_1.txt` do sh script_1.sh $i Currently i am passing one column value to the single unix variable. How can i pass the values from 2... (2 Replies)
Discussion started by: rafa_fed2
2 Replies

8. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

9. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

10. Shell Programming and Scripting

Delete line from remote file over ssh passing variable

I have a variable called $a1 which maps to something like "http://servername proxy1 count http" and a lots of entries in a file on remote server. If I have the following in my .sh script: sed -i "\%$a1%d" mylog.txtthe line is deleted from mylog.txt. Great. I'm trying now to remvoe this from a... (3 Replies)
Discussion started by: say170
3 Replies
MASKTEST(1)							  [FIXME: manual]						       MASKTEST(1)

NAME
masktest - Find differences in wildcard matching between Samba's implementation and that of a remote server. SYNOPSIS
masktest {//server/share} [-U user%pass] [-d debuglevel] [-W workgroup] [-n numloops] [-s seed] [-a] [-E] [-M max protocol] [-f filechars] [-m maskchars] [-v] DESCRIPTION
masktest is a utility for detecting differences in behaviour between Samba's own implementation and that of a remote server. It will run generate random filenames/masks and check if these match the same files they do on the remote file as they do on the local server. It will display any differences it finds. This utility is used by the Samba team to find differences in behaviour between Samba and Windows servers. OPTIONS
-U user%pass Specify the user and password to use when logging on on the shares. This parameter can be specified twice (once for the first server, once for the second). -s seed Seed the random number generator with the specified value. -n numops Set the number of operations to perform. -a Print the operations that are performed. -M max_protocol Maximum protocol to use. -f Specify characters that can be used when generating file names. Default: abcdefghijklm. -E Abort when difference in behaviour is found. -m maskchars Specify characters used for wildcards. -v Be verbose VERSION
This man page is correct for version 4.0 of the Samba suite. SEE ALSO
Samba AUTHOR
This utility is part of the Samba[1] suite, which is developed by the global Samba Team[2]. masktest was written by Andrew Tridgell. This manpage was written by Jelmer Vernooij. NOTES
1. Samba http://www.samba.org/ 2. Samba Team http://www.samba.org/samba/team/ [FIXME: source] 04/16/2014 MASKTEST(1)
All times are GMT -4. The time now is 01:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy