On Thu, Jul 17, 2025 at 2:28 PM Russell Senior <russ...@personaltelco.net> wrote:
> On Wed, Jul 16, 2025 at 9:57 PM Michael Barnes <barnmich...@gmail.com> > wrote: > > > > I have a script that is supposed to grab a weather feed and return the > > current temperature. If grabs the file fine, but does not return the > > temperature. > > > > Here is the line that fails: > > > > T=$(grep "<temp_f>" KEUG.xml |cut -c10- |cut -d '.' -f 1) > > Out of curiosity, why are you truncating the fractional part? > > If you mean why am I using 88 instead of 88.0, I guess I did not explain my use case. At the top of each hour the script runs and grabs the current temperature. I have a folder of audio files from 0-110. When I get the current temperature, the remainder of the script grabs the appropriate file for announcements "The current temperature is 88 degrees." Hence, no need for the fractional part. I certainly don't need the additional hundreds of audio files to say "The current temperature is 88 point five degrees." Michael