Sponsored Content
Full Discussion: Permission denied question
Top Forums Shell Programming and Scripting Permission denied question Post 303035730 by Aurimas on Saturday 1st of June 2019 06:39:32 AM
Old 06-01-2019
Permission denied question

Dear forum members,

Below is my code, but I am getting permission denied when I try to run the script. Can someone explain what I am missing. I am using Mojave and try to run script on terminal.

Code:
#!/bin/bash
read -p "amino acid: " AAA
if [ "$AAA" == "ALA" ] || [ "$AAA" == "VAL" ] || [ "$AAA" == "ARG" ] || [ "$AAA" == "ASN" ] || [ "$AAA" == "ASP" ] || 
   [ "$AAA" == "CYS" ] || [ "$AAA" == "GLY" ] || [ "$AAA" == "ILE" ] || [ "$AAA" == "LEU" ] || [ "$AAA" == "LYS" ] ||
   [ "$AAA" == "MET" ] || [ "$AAA" == "PHE" ] || [ "$AAA" == "PRO" ] || [ "$AAA" == "SER" ] || [ "$AAA" == "THR" ] || 
   [ "$AAA" == "TRP" ] || [ "$AAA" == "TYR" ] || [ "$AAA" == "HIS" ] || [ "$AAA" == "GLN" ] || [ "$AAA" == "GLU" ]
then 
	for i in HS_*.pdb.txt; do
			cat $i | grep -o -i $AAA | wc -l
    	done
elif [ "$AAA" == 0 ]
	then
		exit 1
else
	read -p "amino acid: " AAA
fi

Here's the error:

Quote:
-bash: ./AA_visu_skaiciavimas.sh: Permission denied
I will look forward to your responses.

Sincerely,
User
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

permission denied??

i'm trying to set up my internet connection and i was told i need to edit the file /etc/ppp/pap-secrets but i get a permission denied message...why?? (6 Replies)
Discussion started by: justchillin
6 Replies

2. UNIX for Dummies Questions & Answers

./ Permission Denied.

Could someone tell me why I am getting a permission denied message when I attempt to run this on an out file? Thanks! (8 Replies)
Discussion started by: trouscaillon
8 Replies

3. UNIX for Dummies Questions & Answers

Permission Denied

I just started computer science at UW Milwaukee. When I access the university Solaris system from PuTTY, I get permission denied when I try to access the file I wrote. Now I really have no idea what I'm doing, I just don't understand why I get permission denied in my won directory. Thank You ... (0 Replies)
Discussion started by: howeezy
0 Replies

4. UNIX for Advanced & Expert Users

Permission denied

Hi, I can not execute a .env file $ . /Data/oracle/d03/mydbora/8.0.6/MYDB.env -bash: /Data/oracle/d03/mydbora/8.0.6/MYDB.env: Permission denied Even if : -rwxrwxrwx 1 oracle dba 2903 Mar 5 2007 /Data/oracle/d03/mydbora/8.0.6/MYDB.env Please help. Many thanks. (1 Reply)
Discussion started by: big123456
1 Replies

5. UNIX for Dummies Questions & Answers

Basic question re. permission denied

Hi I have a folder with permissions like this: drwxr-xr-x 2 root root 4096 Mar 4 18:02 sites But when I try to cd to this directory as 'testuser' (member of testuser) I get Permission Denied. My understanding of permissions is that in this case other (say testuser) should be able to... (2 Replies)
Discussion started by: justinwyllie
2 Replies

6. UNIX for Dummies Questions & Answers

Why do I keep getting .:Permission denied?

I'll start off by saying that I know very little about Unix - however, I do know that I have a .profile file in my home directory, and that I should be able to invoke it by typing . profile. However, when I do this for ANY .filename, I get ".: Permission denied". I'm pretty sure that there is... (12 Replies)
Discussion started by: bbersani
12 Replies

7. Red Hat

Permission denied

Hi guys im new to this db i have a small prob while installing websphereportal6.1i think i was installed succesfully but the error im getting is while starting server. check this out # ./serverStatus.sh -all Error loading: /usr/wps61/AppServer/java/jre/bin/classic/libjvm.so: cannot... (1 Reply)
Discussion started by: varma917989
1 Replies

8. Shell Programming and Scripting

Permission denied

I created a user so that when he logs in he will be directed to a menu /etc/passwd user1:x:115:1:Support -SysAd:/export/home/user1:/export/home/suppotrmenu/script.sh However when I logged in remotely from another server by ssh user1@1.1.1.1 , it saysexport/home/suppotrmenu/script.sh:... (4 Replies)
Discussion started by: lhareigh890
4 Replies

9. UNIX for Dummies Questions & Answers

Permission denied

when i run echo "User” > /dev/tty5 why do i get permission denied? :confused: (2 Replies)
Discussion started by: chinababy
2 Replies

10. Ubuntu

Permission denied

Trying to get date into the txt file. It says Permission denied. echo $(date +%I:%M:%S_%D) >> /tmp/systemd_suspend_test_err.txt exec 2>> /tmp/systemd_suspend_test_err.txt if ; then # Do the thing you want before suspend here echo "we are suspending $(date +%I:%M:%S_%D)." elif ;... (5 Replies)
Discussion started by: drew77
5 Replies
ACCESS(2)						      BSD System Calls Manual							 ACCESS(2)

NAME
access -- check access permissions of a file or pathname SYNOPSIS
#include <unistd.h> int access(const char *path, int mode); DESCRIPTION
The access() function checks the accessibility of the file named by path for the access permissions indicated by mode. The value of mode is the bitwise inclusive OR of the access permissions to be checked (R_OK for read permission, W_OK for write permission and X_OK for exe- cute/search permission) or the existence test, F_OK. All components of the pathname path are checked for access permissions (including F_OK). The real user ID is used in place of the effective user ID and the real group access list (including the real group ID) are used in place of the effective ID for verifying permission. Even if a process has appropriate privileges and indicates success for X_OK, the file may not actually have execute permission bits set. Likewise for R_OK and W_OK. RETURN VALUES
If path cannot be found or if any of the desired access modes would not be granted, then a -1 value is returned; otherwise a 0 value is returned. ERRORS
Access to the file is denied if: [ENOTDIR] A component of the path prefix is not a directory. [ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters. [ENOENT] The named file does not exist. [ELOOP] Too many symbolic links were encountered in translating the pathname. [EROFS] Write access is requested for a file on a read-only file system. [ETXTBSY] Write access is requested for a pure procedure (shared text) file presently being executed. [EACCES] Permission bits of the file mode do not permit the requested access, or search permission is denied on a component of the path prefix. The owner of a file has permission checked with respect to the ``owner'' read, write, and execute mode bits, members of the file's group other than the owner have permission checked with respect to the ``group'' mode bits, and all others have permissions checked with respect to the ``other'' mode bits. [EFAULT] Path points outside the process's allocated address space. [EIO] An I/O error occurred while reading from or writing to the file system. [EINVAL] An invalid value was specified for mode. SEE ALSO
chmod(2), stat(2) STANDARDS
The access() function conforms to ISO/IEC 9945-1:1990 (``POSIX.1''). CAVEAT
Access() is a potential security hole and should never be used. 4th Berkeley Distribution April 1, 1994 4th Berkeley Distribution
All times are GMT -4. The time now is 12:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy