我有以下 bash 脚本:
# do some time consuming task here read -p "Give me some input: " input
现在您可能已经猜到了,如果用户在“耗时任务”期间按了一些随机键,那么不需要的输入也会被考虑在内。stdin在发出读取命令之前如何清除(或至少忽略它)?
stdin
linux bash shell stdin
给定一个 gzip 压缩文件,我怎么知道它使用了什么压缩级别(1-9)?
linux compression gzip
linux ×2
bash ×1
compression ×1
gzip ×1
shell ×1
stdin ×1