I have a variable: pkgname=com.google.android.youtube
And the command is
su -c "stockapp=$(pm path $pkgname | grep base | sed 'sed 's/package://g')"
I have checked the variable is passed inside the double quotes but not to $() How can I pass the variables there there??
su) is called. Your variable,stockapp, is set within the shell thatsuspawns, and then it is immediately destroyed together with the shell when it terminates. It is unclear what you want to do.