On Sun, Aug 06, 2023 at 01:38:21PM +1000, Paul Colquhoun wrote > > The date in the text file shoudn't have the quotes around it.
Thank you very much. That works. The actual data file I'm working with has quotes around the dates, so I have to insert an extra step to strip out the quotes with sed. Using the same ztest.txt file... #!/bin/bash xtoday=$( date --date="August 14, 2021" +%F ) echo ${xtoday} read < ztest.txt ytoday=$( echo ${REPLY} | sed "s/\"//g" ) xtoday=$( date --date="${ytoday}" +%F ) echo ${xtoday} ...produces... 2021-08-14 2021-08-14 -- I've seen things, you people wouldn't believe; Gopher, Netscape with frames, the first Browser Wars. Searching for pages with AltaVista, pop-up windows self-replicating, trying to uninstall RealPlayer. All those moments, will be lost in time like tears in rain... time to die.