Your question has nothing whatever to do with Ant. You may get lucky and get an answer anyway but you'd have a lot better chance to post to a newsgroup that specializes in shell script questions. I believe there are some BASH newsgroups for example.
Rhino ----- Original Message ----- From: "Baz" <[EMAIL PROTECTED]> To: "Ant Users List" <[email protected]>; <[EMAIL PROTECTED]> Sent: Tuesday, April 12, 2005 11:37 AM Subject: Help with some shell script and ssh command problems... > Hi all, > > I know this might be a little off the topic but i know this group can help > me with my questions. > > I am trying to execute a ssh command from a shell script. When execute, this > script build.sh fine if i do: ./build.sh > > However, if i do: ./build.sh > logfile 2>&1 ,the ssh command will hang from > time to time and i cannot figure out the reason. The same problem with using > "exec > $LOG_FILE 2>&1" within the script to capture logs. > > Please help before i hurt my head scratching :) > > I attached a couple of functions that I used SSH command within the script > and hope someone can help to identify the issue... > > Thank you. > > Barry > > # ---------------- FUNCTIONS ----------------- > # > > stop_weblogic () { > > echo > echo "INFO: START: stop_weblogic" > echo > echo > echo "INFO: Stopping the weblogic server in host $HOST..." > (ssh -q $HOST "cd $MODULE_BIN_DIR; ant stop_weblogic") & > > echo > echo "INFO: COMPLETED: stop_weblogic" > > sleep 10 > > } > > build () { > > echo > echo "INFO: START: build" > > echo > echo "INFO: Creating build number." > echo > echo > (ssh -q $HOST "cd $MODULE_BIN_DIR; ant build_number") > > echo > echo "INFO: DO ALL!." > echo > echo > (ssh -q $HOST "cd $MODULE_BIN_DIR; ant do_all") > > echo > echo "INFO: Doing EJB." > echo > echo > (ssh -q $HOST "cd $MODULE_BIN_DIR; ant ejb_jars_uptodate") > > echo > echo "INFO: COMPLETED: build" > > } > > # ----------------- MAIN --------------------- > # > > exec > $LOG_FILE 2>&1 > > echo > echo "INFO: START: `date`" > > notify_start; > stop_weblogic; > #get_latest; > pre_build; > #build; > post_build; > start_weblogic; > check_if_wl_server_started; > checkbuild.sh $LOG_FILE > notify_complete; > > echo > echo "INFO: END: `date`" > > -------------------------------------------- > My mailbox is spam-free with ChoiceMail, the leader in personal and corporate anti-spam solutions. Download your free copy of ChoiceMail from www.choicemailfree.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 12/04/2005 > > -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.9.7 - Release Date: 12/04/2005 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
