How to Solve Error: Linux permission denied

1. Preparation

For example, to create a script file for test.sh, the script code is as follows:

# ! /bin/bash 

echo Hello, world!

The function of the code is to output the characters Hello, world!

2. run the script

Switch to the directory where test.sh is located in the terminal and run the program, a Permission denied prompt appears, as follows:

[[email protected] v2]$ ls
test.sh
[[email protected] v2]$ chmod 111 test.sh
[[email protected] v2]$ ls
[[email protected] v2]$. / test.sh
 /bin/bash: ./test.sh: Permission denied

3.modify file permissions

This is that we can modify the file permissions with the help of the chmod command, as follows:

[[email protected] v2] chmod 777 test.sh 
[[email protected] v2] ./test.sh 
Hello,world!

add:

[[email protected] v2] ./test_curl.sh profile_list get

Run the script, profile_list is the corresponding url, get is the request method.

end!

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *