About the use of #!/usr/bin/env python

Source: Internet
Author: User

In some Linux scripts, you need to specify the script's interpreter at the beginning of the line, such as:

!/usr/bin/env python

Again such as:

!/usr/bin/env Perl

So what's the use of env? When do you use this?
The reason why the script is started with Env is that the script interpreter may be installed in different directories in Linux, and Env can be found in the system's path directory. At the same time, Env also prescribes some system environment variables.

The env command is used to display environment variables that already exist in the system and to execute instructions in the defined environment

Reference:

1, http://www.jianshu.com/p/07a58fb1a92f

2, Http://man.linuxde.net/env

About the use of #!/usr/bin/env python

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.