Results 1 to 6 of 6
If you execute a shell script ie: ./script.sh and you
either:
a) Do not have permission to execute the script or
b) Do not have permission to execute commands inside ...
- 10-18-2007 #1Just Joined!
- Join Date
- Apr 2007
- Posts
- 19
./script.sh Permission?
If you execute a shell script ie: ./script.sh and you
either:
a) Do not have permission to execute the script or
b) Do not have permission to execute commands inside the script
- Will it return an error message on the lines of "Can't execute....<blah>" or will it not return anything?
This script is running on a Solaris 9 system but I am happy to hear about what happens on all distro's.
Regards,
Narkie.
- 10-19-2007 #2
Well, let's test it, shall we? I shall execute the following script as a regular user:
I do not have permission to execute "./other_command". Now let's see what happens:Code:#!/bin/bash ./other_command
Does this match what you expected?Code:alex@danu ~/test/bash $ ls -l no_perm -rw-r--r-- 1 alex users 29 Oct 19 00:18 no_perm alex@danu ~/test/bash $ ./no_perm bash: ./no_perm: Permission denied alex@danu ~/test/bash $ chmod +x no_perm alex@danu ~/test/bash $ ls -l no_perm -rwxr-xr-x 1 alex users 29 Oct 19 00:18 no_perm alex@danu ~/test/bash $ ./no_perm ./no_perm: line 3: ./other_command: Permission denied
DISTRO=Arch
Registered Linux User #388732
- 10-19-2007 #3Just Joined!
- Join Date
- Apr 2007
- Posts
- 19
Hmmm, not quite. I am getting ZERO output. I was thinking it was a permission's thing and I can't *get* the permissions at this stage either.
- 10-19-2007 #4
What do you mean you can't get the permissions? "ls -l" will show you the permissions.
Also, perhaps you can show us exactly what you're trying to do?DISTRO=Arch
Registered Linux User #388732
- 10-19-2007 #5Just Joined!
- Join Date
- Oct 2007
- Posts
- 37
Zero output where? You need to redirect errors somewhere. You could also include this in your script.
example:
echo "hello" >> file_I_do_not_have_permission_to_write_to 2>/root/error.log
- 10-26-2007 #6Just Joined!
- Join Date
- Apr 2007
- Posts
- 19
I just could not get access to an account with MORE permissions. ie: root level access. Anyway, the issue has been solved - although I can not give details as the script was just replaced with a known working version
- so there was just an issue with the script.
(>'ing it to an output did nothing at all, there was something seriously wrong with this script.)


Reply With Quote