[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: My script almost works but spams the terminal its launched from if useing dash.



On Sunday 17 April 2016 08:06:13 Thomas Schmitt wrote:

> Hi,
>
> [Second try to send this mail. Looks like lists.debian.org had a
>  few minutes of inconsciousness. No reply on ping or https.]
>
> Gene Heskett wrote:
> > In normal everyday operation, the variable ${InMail} will not be
> > empty.
>
> Well, normally the 10 uF capacitors suffice for the projected
> life time of the dishwasher. :))
>
No.  The fact that it even ran 5 years amazes me.  The use of 16 volt 
electrolytic caps in a 5 volt circuit is an extreme miss-use of that 
type of capacitor because at 5 volts, they do not have enough voltage 
across the oxide film to keep it "formed" so the oxide slowly reverts as 
its in an oxygen free environment since the electrolyte is an extremely 
pure, called technical grade, ethylene glycol. The net result is that 
the 10 uf goes away, often in less than 5 years.  These were down to 
about what they would have been had they been even bigger paper caps, or 
in the .02uf to .03uf range.

The higher voltage stuff was fine although my meter overflows at 1000 uf 
and up. I need to buy my own ESR meter.

Possibly interesting story about the capacitor shortage back in the 70's 
when OPEC rationed the oil.  As the tx supervisor at KXNE-TV-19 for the 
Nebraska ETV folks at the time, it was coming toward the first frost of 
the fall, and I needed to convert the tx coolant to about 30% 
antifreeze.  That antifreeze cannot be contaminated with the usual 
automotive rust and corrosion inhibitors as they would make it 
conductive, whereas pure water, distilled or de-ionized is a great 
insulator. Since that conversion takes a 55 gallon drum of the pure 
stuff, I got on the horn and started trying to run a barrel of it down, 
calling all over the country till I finally found a barrel of technical 
grade, even purer stuff, sitting on the Mobil Oil dock 150 miles away in 
Omaha NE.  Pricy but I bought it, no choice.  That barrel had been 
earmarked for a JIT shipment to Cornel-Dubilair some weeks later.  My 
buying the last barrel in captivity caused much of that capacitor 
shortage.  And until we sorted the OPEC embargo, no petroleum could be 
spared to make any more of it.  It doesn't take much in each cap so that 
barrel was about a years supply for C-D.  Aerovox, Sangamo, Sprague, 
were all in the same boat.

> The bashism "[[ ${InMail} = 'gene' ]]" hides the pitfall that
> whitespace in a variable will normally yield more than word. (That's
> quite unexpected from the general view of shell programming, but
> documented in man bash.)
>
> With conservative shell gestures one should enclose variable
> evaluation in " quotation marks in order to get the content as exactly
> one word:
>
>   $ InMail="a b"
>   $ if [[ ${InMail} = 'gene' ]] ; then echo yes ; else echo no ; fi
>   no
>   $ if test ${InMail} = 'gene'; then echo yes ; else echo no ; fi
>   bash: test: too many arguments
>   no
>   $ if test "${InMail}" = 'gene'; then echo yes ; else echo no ; fi
>   no
>
> With empty text and no "-marks you get the contrary complaint about
> 0 words as evaluation result:
>
>   $ InMail=""
>   $ if test ${InMail} = 'gene'; then echo yes ; else echo no ; fi
>   bash: test: =: unary operator expected
>   no
>
>
> Google "portable shell" tells me that the gesture
>
>   test "x$variable" = xconstant
>
> does not really target empty variable content but rather reserved
> words as variable content.
> The command test(1) (bash builtin or /usr/bin/test) seems to be quite
> tolerant with syntax errors caused by reserved words where operants
> are expected.
> I fail to make it complain about content like
>   $ InMail="("
>   $ InMail="-f"
> if i use proper "-marks.
>
So I should change my single quotes to double-quotes.  And use test. And 
dump the doubled brackets.

Changes made, test run underway. Fetchmail says one incoming, 3 secs 
later kmail beeps.  I think its working. :)  The second possible name 
won't be tested unless a niece in NYS sends me an email, but amanda will 
test the third option in the early morning hours tomorrow.

And I learned a bit more, so the day will not be a total loss.
>
> Have a nice day :)
>
You too, Thomas.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: