1
I'm trying to delete with Terminal Emulator or Termux files located in /data/dalvik-cache/arm. I want to delete all files except for 2 of them: "system@framework@boot.art" and "system@framework@boot.oat". The problem is with the special character "@" found 2 times in the name of the files.
My goal is to write a very rudimentary script for bash, in which I just mount the system, delete everything except those 2, unmount and reboot. Could someone please help me? I'm rather new to all of this. I've searched many websites, man-pages without any luck mixing the removal of multiple file containing special characters and in the same time excluding some.
Here's what I'm trying:
#/system/bin/sh
mount -o rw,remount,rw /system
cd /data/dalvik-cache/arm
shopt -s extglob
rm -v !("system@framework@boot.art"|"system@framework@boot.oat") --> Syntax error
mount -o ro,remount,ro /system
reboot
As indicated, the rm
command (with the extended wildcard)
gets a "Syntax error".
Thank you very much! I wrote the script in a hurry and must have forgotten about the !. I used the bash provided by Termux and it worked! Thanks again! – Alien – 2018-07-11T22:57:42.973