Linux Bash Script: Custom delay code block (bare data save scheme)

Source: Internet
Author: User

In combination with alias and read usage, you can save some scripts that will be run late, or bare data (strings not being 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 16:26 R Eadme.mddrwxr-xr-x    2 Xiaoqian administ        0 Nov  5 22:32 bin/-rwxr-xr-x    1 Xiaoqian administ      792 OCT 16:26 Meditate

Complete, in fact Block1 is a bare data, a BEGIN ... The end block contains any character text that you can understand asblock1= "Ls-la", but this ensures that the text is not extended by the shell engine.


Linux Bash Script: Custom delay code block (bare data save 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.