linux - extract list of subdirectories from input file -


i new in scripting , need on one: have .txt file; in each line have digits, example:

123456 234567 345678 567890 .... 

on other hand, in master directory have subdirectories. in each subdirectory, have file in .xml format. in each of .xml files have 1 tag 6 digits; example: in file 1.xml under sub directory 1, tag value 123456, in file 2.xml under sub directory 2, tag value 111111, in file 3.xml under sub directory 3, tag value 345678, ...

how can extract list of subdirectories , save file there match in digits between .txt file , .xml files? thanks

i able save in output file lines in xml file under sub directories having string searching using command line:

grep -r hdcontent priorite_2_hd/*/adi_new.xml

where priorit_2_hd sub directory , adi_new.xml .xml file

the output looks like

priorite_2_hd/ados_contre_attaquent_les_hd_vf_ingest/adi_new.xml: priorite_2_hd/ainsi_soient_ils_saison_1_vf_w/adi_new.xml: priorite_2_hd/ainsi_soient_ils_serie_vf_w/adi_new.xml: priorite_2_hd/amour_haine_propagande_saison_1_vf_w/adi_new.xml: priorite_2_hd/amour_haine_propagande_saison_2_vf_w/adi_new.xml: priorite_2_hd/amour_haine_propagande_serie_vf_w/adi_new.xml: priorite_2_hd/apparences_saison_1_vf_w/adi_new.xml: priorite_2_hd/apparences_serie_vf_w/adi_new.xml: priorite_2_hd/arthur_saison_11_vf_w/adi_new.xml:

now using awk want put in output file lines having string hdcontent="y". trying use command line

awk 'begin { fs = "/" } ; { if $3== "value="\y\""; print $2, $3}' input.txt

but no luck . thanks


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -