If the sh file is executed in linux, the following error occurs: oswatcher_restart.sh: line13:./startOSW. sh: Permissiondenied.
Source: Internet
Author: User
In linux, when the sh file is executed, the following error occurs: oswatcher_restart.sh: line13:./startOSW. sh: Permissiondenied. 1. view the content of the sh file #! In/usr/bin/ksh linux, the following error occurs: oswatcher_restart.sh: line 13 :. /startOSW. sh: Permission denied solution 1 view the content of the execution sh file [root @ xxxdb0402 dbscripts] # more oswatcher_restart.sh #! /Usr/bin/ksh # export oswdir = 'df | grep mysqllog | awk {'print $6} ''export oswdir =/mysqllog # th = 'PS-ef | grep- v $ | grep OSWatcher. sh' # echo $ th; if ['PS-ef | grep-v grep | grep OSWatcher. sh | wc-l '= "0"] then cd $ oswdir/osw echo "begin 1 ". /startOSW. sh 60 216 else echo "OSWatcher is running" fiexit 2 execute sh command [mysql @ xxxdb0402 dbscripts] $ sh oswatcher_restart.sh begin 1oswatcher_restart.sh: line 13 :. /startOS W. sh: Permission denied [mysql @ xxxdb0402 dbscripts] $ [mysql @ xxxdb0402 dbscripts] $ ll/mysqllog/osw/startOSW. sh-rw-r -- 1 755 mysql 1609 Sep 2/mysqllog/osw/startOSW. sh: It's 755 permission. Why can't it be executed? 3. google: They said they wanted to see the information in the first column, and rwx and other information. r -- --- the file owner is readable, however, you cannot write or execute the r -- File owner and group users (generally, it is the default group where the file owner is located) readable r -- r--files can be read by any user, but cannot write or execute rwx r -- r-files are read, written, and executed by the owner, group users and other users can only read rwx r-x-text files can be read, written, and executed by the owner, the owner can read, write, and execute rwx r-x Files, group users and other users can read and execute rw---- file owner and group User readable, write rw-r-file owner and group User readable, write, other users can read rw---- the owner and group users of the file and other users can read and write the file. use this permission setting with caution, because any user can write this file chmod [who] operator [permission] filen In ame who, u is the file owner permission. g is the group user permission. o other user permissions. a is all user permissions. + add permissions.-cancel permissions. = set permissions. r is the read permission. w is write permission x is execution permission u, g, o operations on file owners, group users, and other users. 4. check the ll file result. If no x mark is displayed, you do not have the execution permission. [mysql @ xxxdb0402 dbscripts] $ ll/mysqllog/osw/startOSW. sh-rw-r -- 1 755 mysql 1609 Sep 2/mysqllog/osw/startOSW. sh 5 Therefore, the 755 permission is re-granted to [root @ xxxdb0402 dbscripts] # chmod 755/mysqllog/osw/startOSW. sh [root @ xxxdb0402 dbscripts] # ll/mysqllog/osw/startOSW. sh-rwxr-xr-x 1 755 mysql 1609 Sep 2/mysqllog/osw/startOSW. sh. x indicates that it can be executed. 6. execute sh again. OK. [Root @ xxxdb0402 dbscripts] # sh oswatcher_restart.sh begin 1oswatcher_restart.sh :. /startOSW. sh:/bin/ksh: bad interpreter: No such file or directory [root @ xxxdb0402 dbscripts] # Another error is reported, but this is another problem.
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