Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does Linux run the sh file

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly analyzes how Linux runs sh files related knowledge points, the content is detailed and easy to understand, the operation details are reasonable, and it has certain reference value. If you are interested, you may wish to follow Xiaobian to have a look. Let's follow Xiaobian to learn more about "how Linux runs sh files".

Method 1: absolute path execution.sh file 1, the following three methods can be, as shown in the following figure

Copy content to clipboard

./ home/test/shell/hello.sh

/home/test/shell/hello.sh

sh /home/test/shell/hello.sh

Method 2: Execute.sh file in current directory 1, cd to directory where.sh file is located

For example, take hello.sh file as an example, as shown below

2. Add x execute permissions to the.sh file

For example, take hello.sh file as an example, chmod u+x hello.sh, as shown below

3、./ Execute.sh file

Take hello.sh file for example,./ hello.sh can execute hello.sh file, as shown below

4. sh Executes.sh file

Take hello.sh file as an example, sh hello.sh can execute hello.sh file, as shown below

Note: Use ".../ "When adding file name.sh to execute, you must add x execution permission to the.sh file.

About "Linux how to run sh file" introduced to this, more related content can be searched for previous articles, hope to help you answer questions, please support the site more!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report