16 lines
		
	
	
		
			329 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			329 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/bin/sh
 | 
						|
HOME=$(tput cup 0 0)
 | 
						|
ED=$(tput ed)
 | 
						|
EL=$(tput el)
 | 
						|
printf '%s%s' "$HOME" "$ED"
 | 
						|
while true
 | 
						|
do
 | 
						|
    ROWS=$(tput lines)
 | 
						|
    COLS=$(tput cols)
 | 
						|
    CMD="$*"
 | 
						|
    ${SHELL:=sh} -c "$CMD" | head -n $ROWS | while IFS= read LINE; do
 | 
						|
        printf '%-*.*s%s\n' $COLS $COLS "$LINE" "$EL"
 | 
						|
    done
 | 
						|
    printf '%s%s' "$ED" "$HOME"
 | 
						|
done
 |