This script elimizes the unregistered subdirectory name under the directory

xiaoxiao2021-03-06  27

Written by c on the script Pike, of course, can be implemented

INT main () {string cmd2 = "CD / home / xxx / u; ls -l | grep ^ D> /Home/xxx/findsavedir.txt"; process.system (cmd2); Write ("list archive folder Fusing! / N "); string strlist = stdio.read_file (" / home / xxx / findsavedir.txt "); array (string) split_str = strlist /" / n ";

Foreach (split_str, string str) {if (str == "null" | | str == "/ r" | STR == "/ n" | STR == "/ r / n") Continue;

String S;

IF (SIZEOF (STR) == 59) // This directory length, according to case, the subdirector I want to find is 2, so write {s = STR [57..sizeof (str)]; IF (s [0]> = '0' && s [0] <= '9' && s [1]> = '0' && s [1] <= '9') // Non-character or digitally do file directory Remove {string utertmp = "CD / home / xxx / u; cp -fr" s "../u.right.bak/"; string utertmp_in = "cd / home / xxx / u; cp -fr" S "../u.right.bak//n"; process.system (useertmp); stdio.append_file ("copydir.txt", useertmp_in); // Best in process.system first look CopyDir.txt There is no problem with the file. } Else {}}}}}

转载请注明原文地址:https://www.9cbs.com/read-65581.html

New Post(0)