From 056ad460825e50f219d737d66d2bec0046af7183 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 30 Apr 2011 18:03:24 +0400 Subject: [PATCH] clear stdin example --- bash/clear_stdin/clear_stdin.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 bash/clear_stdin/clear_stdin.sh diff --git a/bash/clear_stdin/clear_stdin.sh b/bash/clear_stdin/clear_stdin.sh new file mode 100755 index 0000000..30ac415 --- /dev/null +++ b/bash/clear_stdin/clear_stdin.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +clear_stdin() +{ + while read -n1 -t.1 a;do :;done +} + +sleep 3 + +clear_stdin + +echo -n "Введите a: " +read a + +echo $a