I want to loop through only specific directories and delete the first line of files given as input parameters in those directories.
My input parameters should be:
-i [input_directory]- root directory
-n [directory]directories to check for files
sh -i /main/folder/ -n (sub1|sub2|sub6) .txt
Script should only delete header for
*.txt files in
sub6 folders under
Now I have below script which loops through all folders and deletes header but I am not sure how to loop through only specified folder
for $file in $i/*/*.txt do sed '1,1d' $file done
Please let me know if there will be any use if we change the way we input parameters.