Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Executing .sh - permission denied

  1. #1
    Join Date
    Jan 2011
    Beans
    20

    Question Executing .sh - permission denied

    Hi,

    I've been trying to execute run.sh but keep getting "permission denied" even after I've made it executable by entering "chmod +x run.sh"

    This is what I entered and what Terminal churned out:

    username@Tosh-Ubuntu:~$ cd Desktop/linux
    username@Tosh-Ubuntu:~/Desktop/linux$ chmod +x run.sh
    username@Tosh-Ubuntu:~/Desktop/linux$ ./run.sh
    ./run.sh: line 2: ./adb: Permission denied

    ./run.sh: line 7: ./adb: Permission denied


    Help??

    TIA.

  2. #2
    Join Date
    Sep 2006
    Beans
    7,291
    Distro
    Lubuntu Development Release

    Re: Executing .sh - permission denied

    What filesystem are you using there?

    Code:
    mount | grep /dev

  3. #3
    Join Date
    Nov 2010
    Location
    India
    Beans
    4,827
    Distro
    Ubuntu Development Release

    Re: Executing .sh - permission denied

    I think its Android Debugging script. For that If i remembered properly from #XDA , he must run it as a root user with sudo
    Raja

    రాజ శేఖర్ రెడ్డి

  4. #4
    Join Date
    Sep 2006
    Beans
    7,291
    Distro
    Lubuntu Development Release

    Re: Executing .sh - permission denied

    Quote Originally Posted by raja.genupula View Post
    I think its Android Debugging script. For that If i remembered properly from #XDA , he must run it as a root user with sudo
    Yes, now I see the error messages.

    What are the first few lines of the script?

    Code:
    head -n 8 run.sh
    You probably want to take a look through the whole thing really before running it as root, just to be sure.

  5. #5
    Join Date
    Aug 2011
    Location
    52° N 6° E
    Beans
    2,272
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Executing .sh - permission denied

    run.sh is running, but it calls adb.sh, which doesn't run. You may have to give execute permission to adb.sh

  6. #6
    Join Date
    Nov 2010
    Location
    India
    Beans
    4,827
    Distro
    Ubuntu Development Release

    Re: Executing .sh - permission denied

    Yes , its better to have a look before running something
    Raja

    రాజ శేఖర్ రెడ్డి

  7. #7
    Join Date
    Nov 2013
    Beans
    53
    Distro
    Ubuntu

    Re: Executing .sh - permission denied

    Why don't you use sudo?
    Code:
    sudo ./run.sh

  8. #8
    Join Date
    Jan 2011
    Beans
    20

    Re: Executing .sh - permission denied

    Quote Originally Posted by Lars Noodén View Post
    What filesystem are you using there?

    Code:
    mount | grep /dev

    username@Tosh-Ubuntu:~$ mount | grep /dev
    /dev/sda8 on / type ext4 (rw,errors=remount-ro)
    udev on /dev type devtmpfs (rw,mode=0755)
    devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    /dev/sda7 on /boot type ext4 (rw)
    /dev/sda9 on /home type ext4 (rw)
    /dev/sda2 on /boot/efi type vfat (rw)
    /dev/sda5 on /media/username/Loopie type fuseblk (rw,nosuid,nodev,allow_other,default_permissions,b lksize=4096)
    /dev/sdb1 on /media/username/61D3-9E5B type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed ,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)

  9. #9
    Join Date
    Jan 2011
    Beans
    20

    Re: Executing .sh - permission denied

    Quote Originally Posted by Lars Noodén View Post
    Yes, now I see the error messages.

    What are the first few lines of the script?

    Code:
    head -n 8 run.sh
    You probably want to take a look through the whole thing really before running it as root, just to be sure.
    username@Tosh-Ubuntu:~/Desktop/linux$ head -n 8 run.sh
    BASE=$(dirname $0)
    pkg=$($BASE/adb shell pm path com.koushikdutta.backup)
    # apparently pm path appends a carriage return which screws
    # up the class name in dalvikvm invocation
    pkg=$(echo $pkg | cut -d : -f 2 | sed s/\\r//g)
    echo $pkg
    $BASE/adb shell << EOF
    CLASSPATH=$pkg app_process /system/bin com.koushikdutta.shellproxy.ShellRunner2 $@ &

  10. #10
    Join Date
    Jan 2011
    Beans
    20

    Re: Executing .sh - permission denied

    Quote Originally Posted by Impavidus View Post
    run.sh is running, but it calls adb.sh, which doesn't run. You may have to give execute permission to adb.sh
    I gave adb excute permission but now end up with this:


    username@Tosh-Ubuntu:~/Desktop/linux$ ./run.sh
    ./run.sh: line 2: ./adb: No such file or directory

    ./run.sh: line 7: ./adb: No such file or directory

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •