Unix/Linux Go Back    


UNIX for Dummies Questions & Answers This forum is closed for new posts. Please post beginner questions to learn unix and learn linux in this forum UNIX for Beginners Questions & Answers

Fork: Resource Temporarily Unavailable

UNIX for Dummies Questions & Answers


Tags
fork, resource, resource temporarily unavailable, shell scripting

 
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 05-03-2012   -   Original Discussion by monstrousturtle
monstrousturtle's Unix or Linux Image
monstrousturtle monstrousturtle is offline
Registered User
 
Join Date: Apr 2012
Last Activity: 16 May 2012, 9:41 AM EDT
Posts: 7
Thanks: 5
Thanked 0 Times in 0 Posts
Fork: Resource Temporarily Unavailable

I wrote a script that works most of the time but gave me

fork: resource temporarily unavailable

some of the time. I restarted my computer and now it runs fine but googling "fork: resource temporarily unavailable" and looking on the forums has not actually helped me figure out what exactly I was doing to get that message... and I really want to understand.

Please excuse my ignorance and any explanation is welcome.

FYI: I am using cygwin on a Windows OS (though I do not know if this is important information)
Sponsored Links
    #2  
Old Unix and Linux 05-03-2012   -   Original Discussion by monstrousturtle
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 8 December 2017, 4:34 PM EST
Location: Saskatchewan
Posts: 22,541
Thanks: 1,158
Thanked 4,285 Times in 3,954 Posts
It is very important. Thank you for posting it.

What's even more important, of course, is the contents of the script itself, and where the error occurs in it...

'resource temporarily unavailable' may mean your system was running low on memory or the like, and unable to create new processes.

Last edited by Corona688; 05-03-2012 at 03:26 PM..
The Following User Says Thank You to Corona688 For This Useful Post:
monstrousturtle (05-03-2012)
Sponsored Links
    #3  
Old Unix and Linux 05-03-2012   -   Original Discussion by monstrousturtle
monstrousturtle's Unix or Linux Image
monstrousturtle monstrousturtle is offline
Registered User
 
Join Date: Apr 2012
Last Activity: 16 May 2012, 9:41 AM EDT
Posts: 7
Thanks: 5
Thanked 0 Times in 0 Posts
Sorry, I had a feeling that the code was fine and it was something I was doing on my computer (too many other processes running or something like that).

The code makes a reference list in the case I need to use, greps for a line I need, prints that line and copies that line to a file.

Here is the code:


Code:
#!/bin/bash
awk ' {$1=toupper($1) ; print $1":"$2,$3}' > newdb.txt pdbsws_chain.txt
for v in `cat good_ones.txt`       
do
    linewithid=`grep -w $v newdb.txt`          
    echo ${linewithid// /:}
    echo ${linewithid// /:} >> nomut_pdbuniprotfinal.txt
done

    #4  
Old Unix and Linux 05-03-2012   -   Original Discussion by monstrousturtle
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 8 December 2017, 4:34 PM EST
Location: Saskatchewan
Posts: 22,541
Thanks: 1,158
Thanked 4,285 Times in 3,954 Posts
Hmmm. I take it you're grepping for a list of words there? You can probably do that in one grep instead of 10,000:


Code:
grep -f good_ones.txt newdb.txt |
while read LINE
do
        echo "${linewithid// /:}"
done | tee -a nomut_pdbuniprotfinal.txt

There, it runs the programs all at once, instead of running 10,000 of them individually. Much less odds of Windows deciding to throw up on fork() in the middle.

And actually, if you'll explain what you're actually trying to do there in detail, it can probably be done even faster in one single awk.
The Following User Says Thank You to Corona688 For This Useful Post:
monstrousturtle (05-03-2012)
Sponsored Links
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
fork: Resource temporarily unavailable , server unexpectedly unavailable network connection taherahmed UNIX for Advanced & Expert Users 1 09-13-2011 04:57 PM
Resource temporarily unavailable Error In Socket kavinsivakumar UNIX for Dummies Questions & Answers 1 03-02-2010 08:56 AM
Mmap with fork : Resource unavaialable temporarily siddharoodh Solaris 0 07-11-2009 03:20 PM
Fork:resource unavailable samos UNIX for Advanced & Expert Users 5 04-19-2009 09:25 PM
fork: Resource temporarily unavailable - What can I check ? unclefab Solaris 5 04-12-2007 03:22 PM



All times are GMT -4. The time now is 11:14 AM.