> On Thu, Aug 12, 2010 at 1:46 PM, Jan Schampera <jan.schamp...@web.de> wrote: > >> while read -d'' -n1 ch; do
On Thu, Aug 12, 2010 at 01:50:34PM +0800, Sharuzzaman Ahmat Raslan wrote: > Which part is the mistake, and what is the solution? If you want the argument of -d to be an empty string, you have to separate the empty string argument from the -d with some whitespace: read -d '' -n1 ch Otherwise, -d'' is exactly the same as -d (the '' goes away entirely), and read tries to use the -n1 as the argument of -d. Since -d only takes a single character, the - becomes the delimiter.