After search it seems the ascii of EOF is -1,but how can I echo it out?
My purpose of doing this is to test whether it behaves the same as pressing ctrl-d if I just echo out EOF.
|
After search it seems the ascii of EOF is My purpose of doing this is to test whether it behaves the same as pressing
| |||
|
feedback
|
|
There is no way to echo out an EOF. An EOF can only be generated either by reaching the end of a file or by invoking the keypress bound to the | |||||||||||
feedback
|
|
In bash you could write As Ignacio already said, EOF is not a character, so the question how to "echo EOF" doesn't make any sense in the first place. You can echo characters (bytes) or you can close a file descriptor, but you can never echo an EOF. | |||
|
feedback
|