Use ftp to upload C ++ source code to the web site

Source: Internet
Author: User

To implement the following functions: Upload the source code to the web site.

 

First, use Upload. exp to implement automatic FTP upload]

 

#! /Usr/bin/empty CT <br/> set timeout 10 <br/> set username yourusername <br/> set password yourpassword <br/> set host iptvcn.info <br/> set prompt ftp> <br/> set srcfile [lindex $ argv 0] <br/> set dstfile [lindex $ argv 1] <br/> spawn FTP $ host <br/> reverse CT" name "{send" $ username/R "} <br/> your CT" password: "{send" $ password/R "} <br/> your CT" $ prompt "{send" cd cpp/R "} <br/> your CT" $ prompt "{send" put $ srcfile $ dstfile/R "} <br/> reverse CT" $ prompt "{send" Bye/R "} 

 

Because my space is hosted in free Godaddy space, all pages are embedded with Godaddy ads, and all source code files need to be processed, the function is to replace <> with & LT and & gt:

[Upload. Sh]

#! /Bin/sh <br/> file = $1 <br/> echo '<PRE>'> $. TMP <br/> SED's/<// </G' $1 | SED's/> //>/G'> $. TMP <br/> echo '</PRE>'> $. TMP <br/>/usr/bin/upload CT upload. exp $. TMP $ file <br/> RM-RF $. TMP 

Usage:

./Upload. Sh test. cpp

Files are stored in the CPP directory of the site by default.

 

The next goal is to highlight the code syntax.

 

 

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.