Prevent grep from closing stdin
The -q flag was causing grep to close the stdin as the first match is found, causing the exit code of the programs in the pipe to return non-zero, as stdout is closed.
This commit is contained in:
		
							parent
							
								
									b1b4f37032
								
							
						
					
					
						commit
						a7097048f9
					
				| @ -11,7 +11,7 @@ | ||||
| regex="$1" | ||||
| shift | ||||
| 
 | ||||
| "${@}" 2>&1 | stdbuf -i0 -o0 tee /dev/stderr | grep -q "${regex}" | ||||
| "${@}" 2>&1 | stdbuf -i0 -o0 tee /dev/stderr | grep "${regex}" >/dev/null | ||||
| 
 | ||||
| rcprog=${PIPESTATUS[0]} rcgrep=${PIPESTATUS[2]} | ||||
| 
 | ||||
|  | ||||
| @ -11,7 +11,7 @@ | ||||
| regex="$1" | ||||
| shift | ||||
| 
 | ||||
| "${@}" 2>&1 | stdbuf -i0 -o0 tee /dev/stderr | grep -q "${regex}" | ||||
| "${@}" 2>&1 | stdbuf -i0 -o0 tee /dev/stderr | grep "${regex}" >/dev/null | ||||
| 
 | ||||
| rcprog=${PIPESTATUS[0]} rcgrep=${PIPESTATUS[2]} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user