This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
A small problem in Shell Scripts while using the built-in "read" function -- Options not recognised
- From: Surendar Singh Bisht <suren at duncaninfotech dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 17 Jan 2002 17:34:24 +0530
- Subject: A small problem in Shell Scripts while using the built-in "read" function -- Options not recognised
Hi everybody!
I'm using bash 2.05.0(8)-release on win98. I'm confronting a small
problem in shell scripts execution while using the built-in "read" function.
But the same script executes smoothly when I run this code on the command
line.
I'm using a script
echo "Give me a character: "
read -n1 char
echo "character read is $char"
The problem is that the bash is treating the options (-n -p -d etc) as
invalid Options for "read".
And the subsequent lines are executed in sequence.
If I use -----> read -n1 char
I get the errro ----> read: Illegal option -n
If I use -----> read -p "Give me something:" -n1 char
I get the errro ----> read: Illegal option -p
If I use -----> read -d. char
I get the errro ----> read: Illegal option -d
If I use -----> read -d. -p "Give me something: " char
I get the errro ----> read: Illegal option -d
If I use -----> read -p "Give me something: " -d. char
I get the errro ----> read: Illegal option -p
Also other options ( -d, -p etc) are not being recognised.
But the same script executes smoothly when I run this code on the command
line.
Any Insight regarding the topic is welcome.
Warm Regards
Suren
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/