Search code examples
androidshelladbubuntu-12.04pwd

How can i reach as variable of /src last folder in shell script?


this sh script is in <project-dir>/w that named "install.sh"

i want to catch my directory last name "bes" where is <project-dir>/src/com/seri/bes

 #!bin/bash

i use myendpath=${PWD##*/}at this line but variable return "w";

myendpath=ls ../src/com/seri/
me="../bin/$myendpath-debug.apk"
adb uninstall com.seri.$myendpath
adb install $me

how can i reach name value <project-dir>/src/com/seri/* ?


Solution

  • #!bin/sh  
    my1=$(ls ../src/com/seri)
    my2="../bin/$my1-debug.apk"
    adb uninstall com.seri.$my1
    adb install $my2
    

    i did it.. its too usefull working with command line android