Reputation: 11
Is this possible to store list of packages in array using batch script.
SET array=(adb shell pm list packaages -3)
Upvotes: 0
Views: 1270
Reputation: 67216
Although I don't know bash, this is the way to store a list of anything in a variable in Batch:
set Array=adb shell pm list packages -3
for %%v in (%Array%) do echo %%v
To group several words in the same element, enclose they in quotes:
set Array=adb "shell pm" "list packages -3"
In this case you may use this form in order to eliminate the quotes:
for %%v in (%Array%) do echo %%~v
Upvotes: 2