Comment puis-je accéder en tant que variable du dernier dossier /src dans le script shell ?
-
11-12-2019 - |
Question
ce script sh est dans <project-dir>/w
qui a nommé "install.sh"
je veux récupérer le nom de famille de mon répertoire "bes" où se trouve <project-dir>/src/com/seri/bes
#!bin/bash
j'utilise myendpath=${PWD##*/}
sur cette ligne mais variable return "w" ;
myendpath=ls ../src/com/seri/
me="../bin/$myendpath-debug.apk"
adb uninstall com.seri.$myendpath
adb install $me
comment puis-je atteindre la valeur du nom <project-dir>/src/com/seri/*
?
La solution
#!bin/sh
my1=$(ls ../src/com/seri)
my2="../bin/$my1-debug.apk"
adb uninstall com.seri.$my1
adb install $my2
Je l'ai fait .. c'est trop utile fonctionnant avec la ligne de commande Android
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow