#] #] ********************* #] "$d_Qroot""7_regexp [find, grep, sed] patterns for QNial.txt " # www.BillHowell.ca 09Oct2021 initial #**************************** # List of operators, generated with : # $ grep "^#] " "$d_Qroot""7_regexp [find, grep, sed] patterns for QNial.txt" | sed 's/^#\]/ /' # ********************* "$d_Qroot""7_regexp [find, grep, sed] patterns for QNial.txt " List Howells [bash script, QNial optr]s - essential map for finding shit, twig the bash cmd line List usage of one of Howells QNial [optr,var,etc]s - bash command line, substitute for file_ops.ndf : pathL_replace_wordL IS OP pathL wordOldNewL flag_backup d_backup - file_ops.ndf : pathL_replace_wordL 08********08 #] List Howells [bash script, QNial optr]s - essential map for finding shit, twig the bash cmd line # see "$d_bin""0_list Howells [bash scripts, QNial operators].sh" $ find "/media/bill/Dell2/PROJECTS/Qnial/MY_NDFS/" -name "*.ndf" | grep --invert-match "z_Old" | grep --invert-match "z_Archive" | sort | tr \\n \\0 | xargs -0 -IFILE grep "#\] " "FILE" | sed "s/#] /\t/" >>"/media/bill/Dell2/PROJECTS/Qnial/MY_NDFS/0_list of Howells QNial programs.txt" #] List usage of one of Howells QNial [optr,var,etc]s - bash command line, substitute for # actually good for any text in .ndf files $ find "$d_Qndfs" -name "*.ndf" | grep --invert-match "z_Old" | grep --invert-match "z_Archive" | sort | tr \\n \\0 | xargs -0 -IFILE grep --with-filename --line-number "" "FILE" $ host link 'find "' d_webRawe '" -type f -name "*" | grep --invert-match "z_Old\|z_Archive\|code develop_test\|System_maintenance\|Qnial_bag\|Cool emails/\|Electric Universe/References/\|Electric Universe/References/\|Yoonsuck Choe - conf program book/\|fin Head\|Menu\|fin [F,f]ooter\|fin organisations\|i9018xtp.default/extensions/\|[0-9]\{6\} [0-9]\{2\}h[0-9]\{2\}m[0-9]\{2\}s " | sort >"' p_nonuniqueFileList '" ' ; #] file_ops.ndf : pathL_findCountsEach_strL grepSeq := front (srtL EACHLEFT link '\|' #] file_ops.ndf : pathL_replace_wordL sed expressions to build full expr, check for illegal chrs % test for illegal characters in wordOldNewL ; % if I use `| instead of `/ as sed_separator, will that work (eg directories)? ; IF (OR ('$.*/[]^' chrA_anyIn_strA (EACH first wordOldNewL)) ('&/' chrA_anyIn_strA (EACH second wordOldNewL)) ) THEN noerror := o ; write '?pathL_replace_wordL error: $.*/[]^ or &/ chrs in strOldNewL' ; ENDIF ; ... IF flag_word THEN wordOption := '\b' ; ELSE wordOption := '' ; ENDIF ; sed_expr1 := (link 's|' wordOption) EACHRIGHT link (EACH first wordOldNewL) ; sed_expr2 := sed_expr1 EACHLEFT link (link wordOption '|') ; % 11Sep2021 will the semi-colon cause a problem within the string? (shouldn't) ; sed_expr3 := sed_expr2 EACHBOTH link ((EACH second wordOldNewL) EACHLEFT link '|;') ; % remove the final trailing semi-colon ; sed_expr4 := front link sed_expr3 ; #] file_ops.ndf : pathL_findCountsEach_strL grep expressions to build full expr, check for illegal chrs % test for illegal characters in strL ; % if I use `| instead of `/ as grep separator, will that work (eg directories)? ; IF (OR ('$.*/[]^' EACHLEFT in strL)) THEN noerror := o ; write '?pathL_findCountsEach_strL error: $.*/[]^ in strL' ; ENDIF ; % ; IF noerror THEN fout := open p_countsByPath "w ; % ; % build common partial regexp for grep, \b' forces word-only matches ; IF flag_word THEN wordOption := '\b' ; ELSE wordOption := '' ; ENDIF ; grep_expr1 := (link 's|' wordOption) EACHRIGHT link strL ; grep_expr2 := grep_expr1 EACHLEFT link (link wordOption '|') ; % 11Sep2021 will the semi-colon cause a problem within the string? (shouldn't) ; grep_expr3 := grep_expr2 EACHBOTH link ((EACH second strL) EACHLEFT link '|;') ; % remove the final trailing semi-colon ; grep_expr4 := front link grep_expr3 ; #] file_ops.ndf : pathL_replace_wordL check for problematic chrs in str # enddoc