Re: multiple spaces in bash strings. [SOLVED]

2025-07-12 Thread home user via users
On 7/12/25 3:17 AM, Francis Montagnac via users wrote: On Sat, 12 Jul 2025 00:33:44 -0700 Samuel Sieb wrote: On 7/12/25 12:18 AM, Francis Montagnac via users wrote: echo "before if, endchars = "${endchars}"." Beware: word splitting will be done here when expanding ${endchars} because the "

Re: multiple spaces in bash strings. [SOLVED]

2025-07-12 Thread Francis Montagnac via users
On Sat, 12 Jul 2025 00:33:44 -0700 Samuel Sieb wrote: > On 7/12/25 12:18 AM, Francis Montagnac via users wrote: >>> echo "before if, endchars = "${endchars}"." >> >> Beware: word splitting will be done here when expanding ${endchars} >> because the " before it closes the first " >> >> You sho

Re: multiple spaces in bash strings. [SOLVED]

2025-07-12 Thread Samuel Sieb
On 7/12/25 12:18 AM, Francis Montagnac via users wrote: Hi. home user wrote: Here's the real code fragment: # 220 lines of code above here constructs string variables # line1, line2, line3, begchars, and endchars. line1="${begchars}${line1}" line2="${begchars} ${line2}" line3="${begchars}

Re: multiple spaces in bash strings. [SOLVED]

2025-07-12 Thread Francis Montagnac via users
Hi. home user wrote: > Here's the real code fragment: > # 220 lines of code above here constructs string variables > # line1, line2, line3, begchars, and endchars. > line1="${begchars}${line1}" > line2="${begchars} ${line2}" > line3="${begchars} ${line3}" > echo "before if, endchars = "${endc

Re: multiple spaces in bash strings. [SOLVED]

2025-07-03 Thread home user via users
On 7/3/25 4:29 PM, Samuel Sieb wrote: On 7/3/25 3:11 PM, home user via users wrote: snip The things on the right are considered parameters and extra spaces are removed.  You need to quote it as mentioned by others. longstring="${startstring} ${longstring}" That will keep all the space