Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I make a simple script, I get "Text File Busy" when I try to run it.

dbell@det-ui-supergbe:~$ cat > test2
ls
^Z
[2]+  Stopped                 cat > test2
dbell@det-ui-supergbe:~$ chmod a+x test2
dbell@det-ui-supergbe:~$ ./test2
-bash: ./test2: Text file busy
share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

By hitting Control Z you suspended the cat Therefor the file is still open an being written to "in the background".

I suspect you want Control-D for end of file.

It's true that control-z can mean EOF but in this case, because your in a terminal that supports background tasks, Control-Z is suspend.

Try this link for more information.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.