Talking about the difference between Linux script SH and. /

Time:2021-3-3

If. Is not in the path, to execute the executable file in the current directory, use the full path:

./executable-file

Path is an environment variable. If the current directory “.” / “is added to the environment variable, you can directly enter the executable file with executable permission in the current directory without”. “/”

If you want to execute an SH script, regardless of whether the script has executable permissions or not, you can use:

sh [file]

At this time, the file is passed to SH as a parameter. If the file is not in the current directory, the full path should also be used.

There are absolute path and relative path. Both. / and.. / start with relative paths, indicating “under the current directory” and “under the parent directory” respectively.

The difference between the Linux script SH and. / is the whole content shared by Xiaobian. I hope it can give you a reference, and I hope you can support developer more.

Recommended Today

Practice analysis of rust built-in trait: partialeq and EQ

Abstract:Rust uses traits in many places, from simple operator overloading to subtle features like send and sync. This article is shared from Huawei cloud community《Analysis of rust built-in trait: partialeq and EQ》Author: debugzhang Rust uses traits in many places, from simple operator overloading to subtle features like send and sync. Some traits can be automatically […]