To terminate the standard input you have to use Ctrl-D, not Ctrl-Z. With Ctrl-Z the job has been stopped and the text file is busy as stated by the error message in slackware. To recover the stopped job, use the command
(as is without arguments) then either continue to write the content of the file or just terminate using Ctrl-D. After that the script will be runnable.