Linux Bash script: Define your own delay code block (bare data saving scheme)

Source: Internet
Author: User

Combine the alias and read usage methods. The ability to save some scripts that will be deferred, or bare data (strings not extended) into a variable. For later use.

$ alias begin= ' read-d "" $ << "END" ' $ BEGIN block1> ls-la> end$ eval $block 1total 10drwxr-xr-x    1 Xiaoqia n administ     4096  5 22:42/drwxr-xr-x Xiaoqian administ     4096 Nov  5 22:31. /-rw-r--r--    1 Xiaoqian administ        3 Oct 16:26. gitignore-rw-r--r--    1 Xiaoqian administ      435 Oct 31 16: Readme.mddrwxr-xr-x    2 Xiaoqian administ        0 Nov  5 22:32 bin/-rwxr-xr-x    1 Xiaoqian administ      792 Oct to 16:26 meditate

Over, in fact Block1 is also a bare data, a BEGIN ... The end block includes random character text. Can be understood asblock1= "Ls-la", it is only here that the text is not extended by the shell engine.


Linux Bash script: Define your own delay code block (bare data saving scheme)

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.