The main objective is to send a splited file to an android and join it back up with a .sh script, the file is splited to 5MB parts but its total size is unknown (trying to make an universal script), I've splited the file and transferred the file parts and the script to a dir inside the android device and ran the .sh with adb shell sh script.sh.every thing is is ok but the dd command which wont accept a variablefile=$(ls /data/local/tmp/ | grep -i --include=*.tul tul)echo file is $file name=${file%.*}echo short name is $nametmp=${file: -3};num=${tmp//[!0-9]/}echo number of files is $numN=${name}.part1dd if=/data/local/tmp/$${name}.part1 of=/data/local/tmp/cust bs=1024 count=5120i=1while [ $i -le $num ]; dodd if=/data/local/tmp/$${name}.part1$i of=/data/local/tmp/cust bs=1024 count=5120 seek=$((($i-1)*5120))let i=i+1doneecho DONEexitthe output normally is that the end of the name cuts the beginning and I get dd if No such file or directorymeaning/data/local/new_file.part1becomes something like .part1local/new_filewhile in command lind adb shell it works OKadb shell >dd if=/data/local/tmp/$${name}.part1 of=/data/local/tmp/cust bs=1024 count=5120$file is an index file that has the parts name and total number of them generated by the split code (in java)Important to say that Im a total noob and it took me few hours to get to this so any help is appreciated edit:dd if=/data/local/tmp/$name.part$i of=/data/local/tmp/cust bs=1024 count=5120 seek=$((($i-1)*5120))working in command line (adb shell) but when running the .sh file I get .part2: No such file or directory
cant run dd command on android device
linux;bash;shell script;dd;android