我一直在互联网上寻找但没有找到解决方案(很难知道要搜索什么)。我想要一种在输入上显示“当前值”的方法。与read -e -p "something: " -i "this" $variable
类似,但在Busybox中。因为该选项仅在Bash4中可用,这不是默认选项。我将不得不以另一种方式解决它。不确定这是否可行..
read -p "Select by entering an number: " ANS
case $ANS in
1 ) ANS="%R | %a %d %b" ;;
2 ) ANS="%R, %a %d %b" ;;
3 ) read -p "Enter a custom string (ex. %R): " ANS ;;
4 ) ANS="%R" ;;
* ) read -p "Just answer with a number between 1 to 4. Aborting!" end; exit 0 ;;
esac
我想要的是案例#3将显示文件的当前值。防爆。如果文件的%R为当前值。那就是我希望它在输入上显示,以便用户以交互方式更改它。