LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2009, 11:31 AM   #1
Amaranthus
LQ Newbie
 
Registered: Dec 2009
Location: Budapest, Hungary
Distribution: MEPIS MX14
Posts: 19

Rep: Reputation: 0
-sh: ./t: Text file busy


Hi,
I tried to create a 'hello world' type shell script:

cat >t
#!/bin/sh
echo Hello world
^z

Then I issued:
chmod 755 t

ls -l t result:
-rwxr-xr-x 1 root root 20 jan 1 01:25 t

./t results the subject of the thread

operating system is
OpenWrt on ADM5120 embedded controller

I tried the same on Slackware 13 with almost the same result except that the message said:
bad interpreter: text file busy
I checked the SHELL variable by issuing a set command and the value of the SHELL variable is the same as I specified in the script.
(/bin/sh on the Adm5120 system )

Google-ing the error message did not result relevant information. I suppose a linux guru simply points out my mistake.
 
Old 12-12-2009, 11:38 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
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
Code:
fg
(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.
 
Old 12-12-2009, 11:57 AM   #3
Amaranthus
LQ Newbie
 
Registered: Dec 2009
Location: Budapest, Hungary
Distribution: MEPIS MX14
Posts: 19

Original Poster
Rep: Reputation: 0
Thank you very much for your quick help!
Unfortunately my small system doesn't have even vi :-(
Using ^Z was a piece of the ruins of my 20 year old DOS practice and seemed work...
Thank you again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp text file busy error seran Linux - General 4 08-12-2021 03:36 PM
cannot create regular file ...: text file busy laode Linux - General 4 11-27-2012 01:56 AM
Running make menuconfig results in text file is busy. jerel4565 Linux - Kernel 2 07-18-2009 10:40 PM
Text file Busy yusufs Linux - Newbie 7 01-05-2008 06:12 AM
/etc/rc.sysinit: /bin/awk: Text file busy teeno Linux - Software 5 02-23-2005 02:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration