Script: Make sftp look like ftp

Source: Internet
Author: User

Script: Make sftp look like ftp. The purpose of this script is to make the sftp command look exactly the same as ftp at startup. Is to enter the user, remote address and other content. 01 #! /Bin/sh02 03 # mysftp. sh -- make sftp start up more like ftp04 05 echo-n "User account:" 06 read account07 08if [-z "$ account"]; then09 exit 0; 10fi11 12if [-z "$1"]; then13 echo-n "Remote host:" 14 read host15 if [-z "$ host"]; then16 exit 017 fi18else19 host = $120fi21 22 exec/usr/bin/sftp-C $ account @ $ host running result: 01 $ mysftp02User account: taylor03Remote host: intuitive. com04Connecting to intuitive . Com...05taylor@intuitive.com's password: 06 07 sftp> quit08 09 10 $ mysftp intuitive. in the script com11User account: taylor12Connecting to intuitive.com...13taylor@intuitive.com's password: 14 15 sftp> quit, the only trick to note is the exec command on the last line. It replaces the currently running shell with the specified application. Because you know that the sftp command can end after it is called, the effect of this method is better than suspending the shell and waiting until the sftp command is executed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.