I just imported my git config onto my new laptop running Ubuntu20.04, but for some reason few of my git aliases using Bash read
built-in now fail.
[alias]
try = "!read -t 5 -n 1 -p 'Confirm? [Y|n] '"
$ echo "$SHELL, $(git --version)"
/bin/bash, git version 2.25.1
$ GIT_TRACE=1 git try
23:57:46.840752 git.c:703 trace: exec: git-try
23:57:46.840829 run-command.c:663 trace: run_command: git-try
23:57:46.841147 run-command.c:663 trace: run_command: 'read -t 5 -n 1 -p '\''Confirm? [Y|n] '\'''
read -t 5 -n 1 -p 'Confirm? [Y|n] ': 1: read: Illegal option -t
This thread suggests that sh is invoked in which case there is no -t option to the read
built-in.
Given it used to work on my previous laptop ... instead of relying on some workarounds like prepending the alias command with bash -c
, is the shell being used here something that can be configured?
Thank you.