Shell command-line statements

Source: Internet
Author: User

The first step:
SSH Password-free login "with public key, private key"

Step Two:

#!/bin/bash while read server;  Do  "[email protected]" 2 >& 1 "s/^/$           Server:/" &donewait

./bunsan2.sh Free < Servers.txt

Note: While read server considers the input as a variable server

-N SSH option, no read for standard input.

"[Email protected]" to cycle.

2 >&1 without this command, the SSH command writes to the content of the standard error output and is not passed to the SED command. It does this by specifying the beginning of the standard error output to be the same as the standard input.

& Background processing. If this is not the case, a command executes too long to execute the following command.

Step Three:

Contents of the Servers.txt file

[Email protected] 58.241. 41.141 [email protected] 58.241. 41.142 [email protected] 58.241. 41.143

./bunsan2.sh Free < Servers.txt

You can see the results of the three rows.

./bunsan2.sh Free < Servers.txt >dgx.txt or so, continue with redirection.

Shell command-line statements

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.