I have rwo users User1 and User2.
I have this script1.sh inside User2 home folder:
#!/bin/bash
cd /home/user1 && ./script2.sh
that calls script2.sh:
#!/bin/bash
if [ 2 > 1 ]; then
echo TRUE!.
else
echo NOT TRUE!
fi
Now, when I execute script1 using user1, everything works. When I execute with user2 i get this error:
./script2.sh: line 3: 1: Permission denied
Saying I can't.. IF? If I write everything on the terminal, it also works. So my permissions:
-rwxrwxr-x 1 user2 group_with_both_users 149 Ago 19 02:41 script2.sh
-rwxr-xr-x 1 user2 group_with_both_users 60 Ago 19 01:38 script1.sh
I really have no clue of what is going on.