Shell scripts refresh data without line breaks

Source: Internet
Author: User

  1. #! /Bin/bash
  2. While[1]
  3. Do
  4. A = $ (ifconfig eth0 | grep'Rx PAC'| Awk'{Print $2 }'| Awk-F:'{Print $ NF }')
  5. Echo-ne"$ A \ r"# Refresh data without line breaks
  6. Done

Echo

Parameter number:-N. Do not wrap the line at the end.
-E if the following characters appear in the string, it will be specially processed and will not be treated as a general text output:
\ A sends an alert;
\ B Delete the previous character;
\ C does not end with a line break;
\ F line feed, but the cursor remains at the original position;
\ N wrap and move the cursor to the beginning of the line;
\ R move the cursor to the beginning of the line without line breaks;
\ T Insert tab;
\ V is the same as \ F;
\ Insert \ characters;
\ NNN inserts the ASCII characters represented by NNN (octal;
-- Help: Display help
-- Version: displays version information.
The echo commands supported by each shell may be different.
-N does not output the final \ n
-E: Interpreting escape characters
-E does not interpret escape characters

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.