Linux Shell Script Instance----------

Source: Internet
Author: User
Linux Shell Basics

  1. Terminal printing
#!/bin/bash#The printf of Linux termnal,Include "echo,printf"#author by woon echo "The shell\`s name is $0"#examples of echo,printf#默认打印。输出换行echo "Hello World!" echo ‘Hello World!‘#echo -n参数接受不换行输出echo -n "Hello World"echo "Hello World"#-e参数接受双引号内字符串的转移列表echo "Hello\tWorld!"echo -e "Hello\tWorld!"#printf使用文本或由空格分割的参数,可指定输出的宽度、对其方式等,可以格式化输出,默认情况下,printf不输出换行printf "%-5s %-10s %-4s\n" No. NAME Markprintf "%-5s %-10s %-4s\n" 1 Lee 80printf "%-5s %-10s %-4.2f\n" 2 Woon 90.456printf "%-5s %-10s %-4.2f\n" 3 James 85.654321printf "%-5s %-10s %-5.3f\n" 4 Jeff 85.123789
  1. Play Change Amount

Linux Shell Script Instance----------

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.