Shell Basics 20 Some notes

Source: Internet
Author: User

Shell Basics 20 Articles

Transfer from http://bbs.chinaunix.net/thread-452942-1-1.html

Discussion: Bash built-in command read

Read-p "How old r u?"
Echo $age
Read-p "Some words?"-a words
Echo ${words[*]}
Read-p "Password:"-S passwd
Echo $passwd
Read-t 5 Auth
Echo $auth
Read-n 1 Key
Read-dq-p "input something End with Q:" Menu
READ-E file #在这试试命令历史和补齐功能

I think read is very useful, than echo "input:"; Read input ... Easy to use! Like this:
Read input? " Input: "
Echo $input

and read a b c is also useful in this way:
Echo-n "Please year Month Day"
Read a b C
echo $a $b $c

In addition, read the FD, such as the common two file splicing:
While Read-u3 i && read-u4 j;do
echo $i $j
Done 3<afile 4<bfile

Shell Basics 20 Some notes

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.