This simple script should read one letter:
#!/bin/bash
read -n 1 key
echo $key
But it gives the following error
read: Illegal option -n
Executed by hand read -n 1 key works though.
|
This simple script should read one letter:
But it gives the following error
Executed by hand |
||||
|
The To run a script under bash, start it with a shebang line |
|||
|
|
type readin your script, and see what that is – warl0ck Oct 27 '12 at 9:52