Fixup stdin-wrapper
* Use a more universal shebang. * Use the template feature of mktemp to avoid silly gymnastics.
This commit is contained in:
		
							parent
							
								
									151152b446
								
							
						
					
					
						commit
						e68800a28d
					
				| @ -1,4 +1,4 @@ | |||||||
| #!/bin/bash -eu | #!/usr/bin/env bash | ||||||
| 
 | 
 | ||||||
| # Author: w0rp <devw0rp@gmail.com> | # Author: w0rp <devw0rp@gmail.com> | ||||||
| # Description: This script implements a wrapper for any program which does not accept | # Description: This script implements a wrapper for any program which does not accept | ||||||
| @ -10,11 +10,8 @@ | |||||||
| file_extension="$1" | file_extension="$1" | ||||||
| shift | shift | ||||||
| 
 | 
 | ||||||
| temp_file=`mktemp` | temp_file=$(mktemp --tmpdir "ale-XXX$file_extension") | ||||||
| mv "$temp_file" "$temp_file$file_extension" | trap 'rm $temp_file' EXIT | ||||||
| temp_file="$temp_file$file_extension" |  | ||||||
| 
 |  | ||||||
| trap "rm $temp_file" EXIT |  | ||||||
| 
 | 
 | ||||||
| while read -r; do | while read -r; do | ||||||
|     echo "$REPLY" >> "$temp_file" |     echo "$REPLY" >> "$temp_file" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Bjorn Neergaard
						Bjorn Neergaard