Fix bug where "-t;" file was written to cwd.

Pressing 'q' at pager prompt will now quit.
This commit is contained in:
Rob Pearce 2022-06-16 19:28:31 +10:00
parent 4aa14b73b2
commit 4752528d48
1 changed files with 3 additions and 2 deletions

5
t.sh
View File

@ -166,7 +166,7 @@ function loadids() {
profile "start"
# check for duplicate id mappings
sort -o $f -t: -k1,1 --stable --unique "$idfile"
sort -o $idfile -t: -k1,1 --stable --unique "$idfile"
profile "finished removing dupes"
max=0
@ -1174,13 +1174,14 @@ EOF2
}
function nextline() {
local dummy morestring
local dummy morestring rv=0
morestring="<------ more ------>"
printed=$((printed + 1));
if [[ $USEPAGER -eq 1 ]]; then
if [[ $printed -ge $((rows - 2)) ]]; then
echo -en "${CYAN}${morestring}${PLAIN}"
read -n1 -s dummy
[[ $dummy == "q" ]] && { echo; exit 0; }
printf "\r%*s\r" ${#morestring}
printed=0
needtitle=1