I want to add some text to a file.
Using the following command:
$ cat > file
And getting the following error:
cat: -: Resource temporarily unavailable
What is happening? how to debug this?
Below is running fine on RHEL5
$ cat > file
It appears you are trying to write contents to a file from stdin. Try this
$ cat - > file
-
indicates standard input
perl -MFcntl -e 'fcntl STDIN, F_SETFL, fcntl(STDIN, F_GETFL, 0) & ~O_NONBLOCK'
– Oct 06 '20 at 08:48cat
is designed to read in blocking mode, it will exit with an error when reading from stdin fails with an EAGAIN error. Now the problem is to determine which program you have run has messed up your terminal ;-) – Oct 06 '20 at 08:52