Show bad output files tool
This commit is contained in:
		
							parent
							
								
									b02eb4099c
								
							
						
					
					
						commit
						e481cd99c2
					
				
							
								
								
									
										17
									
								
								tool_show_bad_output_files.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								tool_show_bad_output_files.sh
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,17 @@ | ||||
| #!/bin/bash | ||||
| 
 | ||||
| force_delete=$1 | ||||
| 
 | ||||
| find "./output" -type f -name "*.txt" -print0 | | ||||
| 	while IFS= read -r -d $'\0' fn; do | ||||
| 		status="$(grep -i "error" $fn)" | ||||
| 		if [[ "" != ${status} ]]; then | ||||
| 			if [[ "delete" == $force_delete ]]; then | ||||
| 				set -x | ||||
| 					rm $fn | ||||
| 				set +x | ||||
| 			else | ||||
| 				echo "Bad output: $fn" | ||||
| 			fi | ||||
| 		fi | ||||
| 	done | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user