From mboxrd@z Thu Jan 1 00:00:00 1970 From: "grottoBoy rant" Subject: Re: bash scripting..simple question Date: Fri, 13 Sep 2002 13:57:45 +0000 Sender: linux-admin-owner@vger.kernel.org Message-ID: Mime-Version: 1.0 Return-path: List-Id: Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 7bit To: urgrue@tumsan.fi, linux-admin@vger.kernel.org sleep will do what you want, i think. I'm slow to give you the code, but the thought process is: sleep 600 seconds grep output from ps aux for the ssh login attempt maybe, if it hasn't exited then kill the process and continue running the script, maybe? your earlier code will have to make sure that ssh process exits properly on successful completion... ----Original Message Follows---- is there a way, in a bash script, to do something like: execute "this_command these_params" --if-its-not-done-in-600-seconds-then-kill-it-and-return-an-error-code situation is, i have a simple script that logs into remote boxes, and does some checks. it first pings each box to see if the route is up, if that fails it wont even try to log in. but sometimes, a box can be pinged but not logged into, for various reasons. in these cases, the ssh login attempt seems to just sit there and doesnt timeout, and the whole script hangs, waiting until ssh exits. which i have observed to take at times HOURS, at times it _never_ exits. any suggestions? - To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com