Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Passing variable between servers Post 302370295 by temhem on Wednesday 11th of November 2009 04:16:11 AM
Old 11-11-2009
THANK SO MUCH sysrenan,

i successed login to server B without password(vi RSA algorithm).
But before running "scp user@serverB:/home/user/variable_file.txt ./"
i have to run topl.sh script on serverB automatically (without manuel).

i can login to serverB without password. after login i have to run topl.sh that will creat "odeme" and "taksit" files. After generation files i will copy these files to serverA via mget command.

But after login "topl.sh" script cant run automatically.

But after login i cant run ""
sftp username@serverB
cd /home/oper
sh ./topl.sh
mget odeme
mget taksit
bye
!

Really you are very helpfully,thanx a lot again.

---------- Post updated at 04:16 AM ---------- Previous update was at 03:28 AM ----------

last part was that:

sftp username@serverB<<-EOF
cd /home/oper
sh ./topl.sh
mget odeme
mget taksit
bye
EOF
 

10 More Discussions You Might Find Interesting

1. Programming

Passing C Variable To Unix

I want to pass a variable set in my c program to a shell script (which will also be invoked or initiated from the same C program using the C's system command). Is it possible ? :confused: (3 Replies)
Discussion started by: kapilv
3 Replies

2. UNIX for Dummies Questions & Answers

Variable passing

Hi, If a script A(Parent) is running and script B(child) is run from script A, will the variables in script A be past to script B? Will the variables exist only for the duration of running the script? Thank you (2 Replies)
Discussion started by: whugo
2 Replies

3. Shell Programming and Scripting

Passing variable to perl

I need a non-perl (bash) way to strip the path from a list of "find" results. Below is the perl version which I could use, if I could figure out how to call the script with a variable (like in sh, $1 is the variable passed in ./script variable) $file = "/path/to/file.txt"; # How do I... (2 Replies)
Discussion started by: TheCrunge
2 Replies

4. UNIX for Dummies Questions & Answers

passing a variable inside a variable to a function

I would like to know how to pass a variable inside a variable to a function. sample code below -------------- for x in 1 9 do check_null $C$x ##call function to check if the value is null if then echo "line number:$var_cnt,... (2 Replies)
Discussion started by: KingVikram
2 Replies

5. Shell Programming and Scripting

passing a variable inside another variable.

Any help would be great. I know this is a dumb way of doing this, but I would like to know if there is a solution doing it this way. I'm very new at this and I'd like to learn more. Thanks! :D:D count=0 while ; do echo "enter your name" read name_$count let count=count+1 done ... (2 Replies)
Discussion started by: reconflux
2 Replies

6. Shell Programming and Scripting

Passing Variable in sed

Dear All, I want to print a file. First I tried with this sed '2q;d' filename it worked. But when i put following it is not working x=2; sed '$xq;d' filename Would any one suggest how to pass the variable? (7 Replies)
Discussion started by: saifurshaon
7 Replies

7. Shell Programming and Scripting

Passing variable with *

Hi Folks, I would like to pass a variable with a wild card in an argument. My script works if I don't use a wildcard but fails when I use *. I want to use the script like: scriptname -F <filename*> @ i = 0 while ($i <= ${#argv}) switch ($argv) case -F: set j = `echo $i +1... (2 Replies)
Discussion started by: dixits
2 Replies

8. Shell Programming and Scripting

Passing dynamic variable within another variable.

I have a small program which needs to pass variable dynamically to form the name of a second variable whose value wil be passed on to a third variable. ***************** Program Start ****************** LOC1=/loc1 PAT1IN=/loc2 PAT2IN=/loc3 if ; then for fpattern in `cat... (5 Replies)
Discussion started by: Cyril Jos
5 Replies

9. UNIX for Dummies Questions & Answers

Passing value of a variable in sed

Hi, I want to pass value of a variable track_line which is the line number to sed. Sed should print the lines starting from track_line till the last line of the file. I tried the below command but it is not working. sed -n '${track_line},$p' latest_log_file I tried using the below too but... (1 Reply)
Discussion started by: nitinupadhyaya8
1 Replies

10. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies
LOGIN(1)						      General Commands Manual							  LOGIN(1)

NAME
login - sign on SYNOPSIS
login [ username ] DESCRIPTION
The login command is used when a user initially signs on, or it may be used at any time to change from one user to another. The latter case is the one summarized above and described here. See `How to Get Started' for how to dial up initially. If login is invoked without an argument, it asks for a user name, and, if appropriate, a password. Echoing is turned off (if possible) during the typing of the password, so it will not appear on the written record of the session. After a successful login, accounting files are updated and the user is informed of the existence of .mail and message-of-the-day files. Login initializes the user and group IDs and the working directory, then executes a command interpreter (usually sh(1)) according to speci- fications found in a password file. Argument 0 of the command interpreter is `-sh. Login is recognized by sh(1) and executed directly (without forking). FILES
/etc/utmp accounting /usr/adm/wtmp accounting /usr/mail/* mail /etc/motd message-of-the-day /etc/passwd password file SEE ALSO
init(8), newgrp(1), getty(8), mail(1), passwd(1), passwd(5) DIAGNOSTICS
`Login incorrect,' if the name or the password is bad. `No Shell', `cannot open password file', `no directory': consult a programming counselor. LOGIN(1)
All times are GMT -4. The time now is 09:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy