[XDA Assist] Rejerf:
I'm terribly new to recovery scripting. Why I'm I getting code 6 error in TWRP?

Line endings are LF already in the "updater-script" file.

ui_print("+-------------------------------------+");
ui_print("| ANDROID DEBLOATER |");
ui_print("+-------------------------------------+");

ui_print(" ");
show_progress(0.0, 1);
run_program("/sbin/sleep", "1");

ui_print("***REMOUNTING /SYSTEM***");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
ui_print(" ");
ui_print(" ");

ui_print("***REMOUNTING /CUST***");
run_program("/sbin/busybox", "umount", "/cust");
run_program("/sbin/busybox", "mount", "/cust");
ui_print(" ");
ui_print(" ");

show_progress(0.1, 1);
run_program("/sbin/sleep", "1");

ui_print("***CREATING BACKUP FOLDERS***");
run_program("/sbin/busybox", "mkdir", "/system/Debloat");
run_program("/sbin/busybox", "mkdir", "/system/Debloat/cust");
run_program("/sbin/busybox", "mkdir", "/system/Debloat/cust/app");
run_program("/sbin/busybox", "mkdir", "/system/Debloat/system");
run_program("/sbin/busybox", "mkdir", "/system/Debloat/system/app");
run_program("/sbin/busybox", "mkdir", "/system/Debloat/system/etc");
run_program("/sbin/busybox", "mkdir", "/system/Debloat/system/priv-app");
ui_print(" ");
ui_print(" ");

show_progress(0.2, 1);
run_program("/sbin/sleep", "1");

ui_print("***SETTING PERMISSIONS FOR BACKUP FOLDERS***");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/cust");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/cust/app");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/system");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/system/app");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/system/etc");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/system/priv-app");
ui_print(" ");
ui_print(" ");

show_progress(0.3, 1);
run_program("/sbin/sleep", "1");

ui_print("***MOVING /CUST/APP/CUSTOMIZED***");
run_program("/sbin/busybox", "mv", "/cust/app/customized", "/system/Debloat/cust/app");
ui_print(" ");
ui_print(" ");

show_progress(0.4, 1);
run_program("/sbin/sleep", "1");

ui_print("***MOVING /SYSTEM/APP***");
run_program("/sbin/busybox", "mv", "/system/app/AnalyticsCore", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/AntHalService", "/system/Debloat/system/app/"); #for smartwatches, tracking sports etc.
#run_program("/sbin/busybox", "mv", "/system/app/AntiSpam", "/system/Debloat/system/app/"); #block numbers
run_program("/sbin/busybox", "mv", "/system/app/BasicDreams", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/BookmarkProvider", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/BugReport", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Chrome", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/Cit", "/system/Debloat/system/app/"); #diagnostics
run_program("/sbin/busybox", "mv", "/system/app/CloudPrint2", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/CloudService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/CTNVItem", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/DMService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/DocumentsUI", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Drive", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Email", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/fastdormancy", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/FileExplorer", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Galaxy4", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Gmail2", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/GoogleTTS", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/GuardProvider", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Hangouts", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/HoloSpiralWallpaper", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/HTMLViewer", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/KeyChain", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/KingSoftCleaner", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/KSICibaEngine", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/LatinImeGoogle", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/LiveWallpapers", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/LiveWallpapersPicker", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Maps", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/matcli", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiDiscover", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiDrive", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiLinkService", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/MiGalleryLockscreen", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiLivetalk", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiPlay", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiuiVideo", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiuiVideoPlayer", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/MiWallpaper", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/ModemTestMode", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Music2", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/NetworkAssistant2", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/NfcNci", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/NFCtestSvc", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/NoiseField", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Notes", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PacProcessor", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PartnerBookmarksProvider", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PaymentService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PerfTurbo", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/PersonalAssistantPlugin", "/system/Debloat/system/app/"); #breaks MiLauncher if removed
#run_program("/sbin/busybox", "mv", "/system/app/PowerKeeper", "/system/Debloat/system/app/"); #battery optimizer
run_program("/sbin/busybox", "mv", "/system/app/PhaseBeam", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Photos", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PhaseBeam", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PhotoTable", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/PrintSpooler", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/SecurityAdd", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/SecurityCoreAdd", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SeempService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SmsExtra", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SpacesCore", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SpacesPolicyApp", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SSCMService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/StepsProvider", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Stk", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SYSOPT", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/SystemAdSolution", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/talkback", "/system/Debloat/system/app/");
#run_program("/sbin/busybox", "mv", "/system/app/ThemeManager", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/TouchAssistant", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/TranslationService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/uimremoteclient", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Updater", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Videos", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/WAPPushManager", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/WfdService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/Whetstone", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/xdivert", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/XiaomiAccount", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/XiaomiServiceFramework", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/XiaomiSimActivateService", "/system/Debloat/system/app/");
run_program("/sbin/busybox", "mv", "/system/app/YouTube", "/system/Debloat/system/app/");
ui_print(" ");
ui_print(" ");

show_progress(0.5, 1);
run_program("/sbin/sleep", "1");

ui_print("***MOVING /SYSTEM/DATA-APP***");
run_program("/sbin/busybox", "mv", "/system/data-app", "/system/Debloat/system");
ui_print(" ");
ui_print(" ");

show_progress(0.6, 1);
run_program("/sbin/sleep", "1");

ui_print("***MOVING /SYSTEM/ETC***");
run_program("/sbin/busybox", "mv", "/system/etc/WhetstonePermission", "/system/Debloat/system/etc");
ui_print(" ");
ui_print(" ");

show_progress(0.7, 1);
run_program("/sbin/sleep", "1");

ui_print("***MOVING /SYSTEM/PRIV-APP***");
run_program("/sbin/busybox", "mv", "/system/priv-app/Backup", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/BackupRestoreConfirmation", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Browser", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Calendar", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/CallLogBackup", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/CellBroadcastReceiver", "/system/Debloat/system/priv-app/");
#run_program("/sbin/busybox", "mv", "/system/priv-app/CleanMaster", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/CloudBackup", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/CloudServiceSysbase", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/CNEService", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/DownloadProviderUi", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/dpmserviceapp", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/FindDevice", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/GoogleFeedback", "/system/Debloat/system/priv-app/");
#run_program("/sbin/busybox", "mv", "/system/priv-app/GoogleOneTimeInitializer", "/system/Debloat/system/priv-app/"); #required for first boot
run_program("/sbin/busybox", "mv", "/system/priv-app/ims", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/ManagedProvisioning", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/MiDrop", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Mipub", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/MiuiGallery", "/system/Debloat/system/priv-app/");
#run_program("/sbin/busybox", "mv", "/system/priv-app/MiuiKeyguard", "/system/Debloat/system/priv-app/"); #breaks lockscreen if removed
run_program("/sbin/busybox", "mv", "/system/priv-app/MiuiVideo", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/MiVRFramework", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Mms", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Music", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/MusicFX", "/system/Debloat/system/priv-app/");
#run_program("/sbin/busybox", "mv", "/system/priv-app/OneTimeInitializer", "/system/Debloat/system/priv-app/"); #required for first boot
#run_program("/sbin/busybox", "mv", "/system/priv-app/PersonalAssistant", "/system/Debloat/system/priv-app/"); #breaks MiLauncher if removed
run_program("/sbin/busybox", "mv", "/system/priv-app/QuickSearchBox", "/system/Debloat/system/priv-app/");
#run_program("/sbin/busybox", "mv", "/system/priv-app/SecurityCenter", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/SpacesManagerService", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/SpacesTrustAgent", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Tag", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/Velvet", "/system/Debloat/system/priv-app/");
run_program("/sbin/busybox", "mv", "/system/priv-app/YellowPage", "/system/Debloat/system/priv-app/");
ui_print(" ");
ui_print(" ");

show_progress(0.8, 1);
run_program("/sbin/sleep", "1");

ui_print("***COPYING FILES***");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/system/app/ClassicKeyboard");
run_program("/sbin/busybox", "chmod", "755", "/system/Debloat/system/app/ClassicKeyboard/ClassicKeyboard.apk");
ui_print(" ");
ui_print(" ");

show_progress(0.9, 1);
run_program("/sbin/sleep", "1");

ui_print("***UNMOUNTING /SYSTEM***");
run_program("/sbin/busybox", "umount", "/system");
ui_print(" ");
ui_print(" ");

show_progress(1, 1);

ui_print("OPERATION COMPLETED");
ui_print("ENJOY!");
ui_print(" ");