Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: How to make a thread to wait till a command on shell get completed.

by techman2006 (Beadle)
on Dec 02, 2013 at 07:44 UTC ( [id://1065237]=note: print w/replies, xml ) Need Help??


in reply to Re: How to make a thread to wait till a command on shell get completed.
in thread How to make a thread to wait till a command on shell get completed.

Basically I am using back tick operator due to which multiple instance of gzip get triggered as the thread is not waiting for the shell to return.

So how I can achieve blocking of thread in case of back tick.

  • Comment on Re^2: How to make a thread to wait till a command on shell get completed.

Replies are listed 'Best First'.
Re^3: How to make a thread to wait till a command on shell get completed.
by choroba (Cardinal) on Dec 02, 2013 at 08:02 UTC
    Back ticks also wait for the command to finish. Do you use &? Show some code!
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re^3: How to make a thread to wait till a command on shell get completed.
by BrowserUk (Patriarch) on Dec 02, 2013 at 08:38 UTC
    Basically I am using back tick operator due to which multiple instance of gzip get triggered as the thread is not waiting for the shell to return.

    Backticks also block. (Unless you are deliberately backgrounding the command, in which case, don't do that!)

    Post your failing code and you'll get help.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^3: How to make a thread to wait till a command on shell get completed.
by dasgar (Priest) on Dec 02, 2013 at 08:03 UTC

    Can you share example code that recreates the issue that you're seeing? Also, do you have a need for using back ticks?

    In the mean time, without seeing your code, I can think of two suggestions. First, use the system command instead of backticks like BrowserUk suggested. Second, try using modules like Archive::Tar to extract your tar files instead of using backticks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1065237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 05:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found