Sponsored Content
Top Forums UNIX for Dummies Questions & Answers SFTP in non-interactive mode without password Post 302899795 by vilasak on Thursday 1st of May 2014 05:11:14 PM
Old 05-01-2014
I am using expect function for doing this.. below is the script i am using.
Code:
#!/usr/bin/expect
spawn sftp <userid>@<ftpServerName>
expect "password:"
send "<password>\n";
expect "sftp>"
send "cd /home/xyz\n"
expect "sftp>"
send "lcd /ftp_data/xyz\n"
send "mget *\n"
expect "sftp>"
send "exit \n"
interact

expect function included in tcl package or you can download it from any open source website.

Last edited by Franklin52; 05-02-2014 at 03:39 AM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Interactive Mode?

:confused: Can anyone please tell me how to get into Interactive Mode? (2 Replies)
Discussion started by: Nomad
2 Replies

2. Shell Programming and Scripting

Perl Interactive mode

Hi All, Does perl has an interactive mode like other shell? If there is, can any one show me the equivalent code for the below csh script ? This csh code prompts user for their name and prints the name. #!/bin/csh echo -n "Pls enter the your name: " set name = ($<) echo "You hav... (2 Replies)
Discussion started by: Raynon
2 Replies

3. UNIX for Advanced & Expert Users

SU command in non interactive mode

Can i run the SU command in a non interactive mode. What i want to do is to pass the username and the password as commandline or batch parameters. Please let me if its possible and how to pass them. A sample file will be appreciated. Thanks, (6 Replies)
Discussion started by: rohitag
6 Replies

4. Solaris

Solaris 10 Jumpstart goes to interactive mode instead of using sysidcfg

Ever since I have started using Solaris 10 images, I have had a problem I can not find a solution for. I have a Solaris 10 image that I created from a Solaris 10 DVD. The sysidcfg file has been created and set up in the bootparams file. I have no issues in Solaris 8 or 9. In Solaris 10, the... (5 Replies)
Discussion started by: rsherry
5 Replies

5. Shell Programming and Scripting

script to non interactive mode

Gud morning everybody, I need small help form you people,Please advice me. I have a utility(adpatch) which takes 10-15 prompts, i want to automate this by calling this utility in shell script. Now my qiestion i want to run the script in non interactive mode. An example. $adpatch... (1 Reply)
Discussion started by: swetham.apps
1 Replies

6. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

7. Solaris

Doubt in zlogin non interactive mode........

I want zlogin -C as non interactive mode so after booting the zone I created a file sysidcfg in /etc directory of the zone the sysidcfg file info as shown below. system_locale=C terminal=dtterm network_interface=primary { hostname=my-zone } security_policy=NONE... (1 Reply)
Discussion started by: vijaysachin
1 Replies

8. UNIX for Advanced & Expert Users

sudo in non interactive mode

Hi , I login to unix using my id and then do a sudo to execute any programs i want. sudo su - <id> password : xxxxxxx Is there a way to make it non interactive so that i can use it in shell script. (1 Reply)
Discussion started by: ashwin3086
1 Replies

9. Shell Programming and Scripting

Expect command use for interactive mode of scripting

Hi All, I am writing a script(Auto_Installation.sh) which is calling one another script (./update_manager /spare/install/HO7/PME_Response_file.txt) Now the issue is result of (./update_manager /spare/install/HO7/PME_Response_file.txt) script is ##########################################... (6 Replies)
Discussion started by: Dhruvak
6 Replies

10. Shell Programming and Scripting

SFTPing non-interactive mode

Hi All, I need to sftp without any intervention.(LInux,Ksh) I have tried some ideas listed here...but its not working... Please advise on it. (1 Reply)
Discussion started by: jesu
1 Replies
asadmin-list-jmsdest(1AS)					   User Commands					 asadmin-list-jmsdest(1AS)

NAME
asadmin-list-jmsdest, list-jmsdest - gets all the physical destinations SYNOPSIS
list-jmsdest --user admin_user[--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile file- name][--terse=false] [--echo=false] [--interactive][--desttype|-T topic|queue] Gets all the physical JMS destinations. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. --desttype type of JMS destination. Valid values are topic, and queue. Example 1: Using list-jmsdest asadmin> list-jmsdest ----user admin --password adminadmin --host bluestar --port 4848 server PhysicalQueue queue {} PhysicalTopic topic {} Command list-jmsdest executed successfully EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-create-jmsdest(1AS), asadmin-delete-jmsdest(1AS) J2EE 1.4 SDK March 2004 asadmin-list-jmsdest(1AS)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy