* [Drbd-dev] crm-fence-peer.sh missing shell expansion
@ 2015-05-08 4:55 Justin Pryzby
2015-05-08 8:03 ` Roland Kammerer
0 siblings, 1 reply; 3+ messages in thread
From: Justin Pryzby @ 2015-05-08 4:55 UTC (permalink / raw)
To: drbd-dev
There are several instances of unexpanded variables in here:
sleep $(( net_hickup_time - SECONDS ))
reboot_timeout=$(( reboot_timeout + SECONDS ))
echo WARNING "${extra_msg}going to reboot -f in $(( reboot_timeout - SECONDS )) seconds! To cancel: kill $$"
if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Drbd-dev] crm-fence-peer.sh missing shell expansion
2015-05-08 4:55 [Drbd-dev] crm-fence-peer.sh missing shell expansion Justin Pryzby
@ 2015-05-08 8:03 ` Roland Kammerer
2015-05-08 15:09 ` Justin Pryzby
0 siblings, 1 reply; 3+ messages in thread
From: Roland Kammerer @ 2015-05-08 8:03 UTC (permalink / raw)
To: drbd-dev
On Thu, May 07, 2015 at 11:55:17PM -0500, Justin Pryzby wrote:
> There are several instances of unexpanded variables in here:
>
> sleep $(( net_hickup_time - SECONDS ))
> reboot_timeout=$(( reboot_timeout + SECONDS ))
> echo WARNING "${extra_msg}going to reboot -f in $(( reboot_timeout - SECONDS )) seconds! To cancel: kill $$"
> if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \
Could you be a bit more precise where you _exactly_ see the problem,
please? "Several" does not help a bash n00b like me. Do you mean the '$'
is missing for example for 'SECONDS'?
If so, that isn't a problem:
----------8<----------8<----------
#!/bin/bash
FOO=42
BAR=23
echo $(( FOO - BAR ))
----------8<----------8<----------
Which will echo 19...
Regards, rck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Drbd-dev] crm-fence-peer.sh missing shell expansion
2015-05-08 8:03 ` Roland Kammerer
@ 2015-05-08 15:09 ` Justin Pryzby
0 siblings, 0 replies; 3+ messages in thread
From: Justin Pryzby @ 2015-05-08 15:09 UTC (permalink / raw)
To: drbd-dev
On Fri, May 08, 2015 at 10:03:26AM +0200, Roland Kammerer wrote:
> On Thu, May 07, 2015 at 11:55:17PM -0500, Justin Pryzby wrote:
> > There are several instances of unexpanded variables in here:
> >
> > sleep $(( net_hickup_time - SECONDS ))
> > reboot_timeout=$(( reboot_timeout + SECONDS ))
> > echo WARNING "${extra_msg}going to reboot -f in $(( reboot_timeout - SECONDS )) seconds! To cancel: kill $$"
> > if out=$( crmadmin -t $(( cibtimeout * 200 )) -S $DRBD_PEER ) \
>
> Could you be a bit more precise where you _exactly_ see the problem,
> please? "Several" does not help a bash n00b like me. Do you mean the '$'
> is missing for example for 'SECONDS'?
Yes, I was referring to that .. but, oh my goodness, you're right ..
Sorry for noise and thanks for the lesson :)
Justin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-08 15:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-08 4:55 [Drbd-dev] crm-fence-peer.sh missing shell expansion Justin Pryzby
2015-05-08 8:03 ` Roland Kammerer
2015-05-08 15:09 ` Justin Pryzby
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.