Re: Deployment rather than development mode --> StartupItems fix
Re: Deployment rather than development mode --> StartupItems fix
- Subject: Re: Deployment rather than development mode --> StartupItems fix
- From: LD <email@hidden>
- Date: Fri, 30 Sep 2005 12:08:34 +1000
Hi there,
also note that the StopService syntax for the WebObjects startup item
(/System/Library/StartupItems/WebObjects/WebObjects) is wrong on two
counts. The Zsh shell doesn't interpret whitespace separated strings
as arrays by default.
-- PROBLEM #1 --
BASH_ARRAY="one two three" # is simply a zsh string
ZSH_NATIVE_ARRAY=(one two three)
in zsh, however, you can use the BASH_ARRAY as an array by doing $
{=BASHARRAY}
-- PROBLEM #2 --
In bash you can create a variable such as:
CMD="/bin/ls -la ~/Desktop"
STR=`$CMD`
In zsh this will cause an error. The fix in zsh:
STR=`eval $CMD`
## THE FIXED VERSION
StopService ()
{
if [ "$PRINTSTARTSTOPMESSAGES" = "YES" ]; then
ConsoleMessage "Stopping WebObjects services"
fi
local PSCOMMAND="$PS -jaxwwwww"
WOSERVICEPIDS=`eval $PSCOMMAND | $GREP "$WOSERVICE" | $GREP -
v grep | $AWK '{print $2}'`
for parent in ${=WOSERVICEPIDS}
{
WOSERVICECHILDPIDS=`eval $PSCOMMAND | $AWK 'NF>3 {if
( $3 =='"$parent"' ) print $2}'`
StopPID $parent
for child in ${=WOSERVICECHILDPIDS}
{
StopPID $child
}
}
}
with regards,
--
LD
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden