Shell script for utility (not periodically updated)

Source: Internet
Author: User

1, the implementation of the Sourse directory part of the file (the file name is listed as a text list, text file name list), copied to another directory/opt/targe/

#!/bin/bashcd/opt/source for file in ' cat/opt/source/list ';d ocp-r-n $file/opt/targe/done

Note: "On the TAB key, the cp-n represents not overwritten."

Extended scp-p Port number [email protected]:/opt/source//opt/targe/


2.

#!/bin/bashfor str in 1 2 3 4 5do echo-e "The value is: $STR \ n" Done

Output

The value is:1 the value is:2 the value is:3 the value is:4 the value is:5
#!/bin/bashfor str in "1 2 3 4 5" Does Echo-e "the value is: $STR \ n" Done

Output

The Value is:1 2 3 4 5


This article is from the "Shepherd Code" blog, please be sure to keep this source http://466716241.blog.51cto.com/1475798/1640762

Shell script for utility (not periodically updated)

Related Article

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.