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 "
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
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}
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
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
On 7/3/25 3:11 PM, home user via users wrote:
(replying to several)
Thank-you everyone that replied.
This is the first bash script I've tried to write in about 8 years.
The '$' in front of the variable in the left side of the assignment was
definitely an error. Removing it eliminated an erro
(replying to several)
Thank-you everyone that replied.
This is the first bash script I've tried to write in about 8 years.
The '$' in front of the variable in the left side of the assignment was
definitely an error. Removing it eliminated an error message.
Thank-you, everyone. But that's n
Francis Montagnac via users wrote:
> On Tue, 1 Jul 2025 21:42:20 -0600
>
>> me@road-runner:~$ cat spaces1.bash
>> #!/bin/bash
>
>> $longstring="${startstring} ${longstring}"
>
> The error is here:
Well, `s/The/An/` there. ;)
The OP had multiple attempts to work out the issue, but the
primary
Hi.
On Tue, 1 Jul 2025 21:42:20 -0600
> me@road-runner:~$ cat spaces1.bash
> #!/bin/bash
> $longstring="${startstring} ${longstring}"
The error is here: no $ before longstring (bash != perl :-) ), ie:
longstring="${startstring} ${longstring}"
--
francis
--
home user via users wrote:
> f42 workstation.
>
> I'm trying to prepend a string and multiple spaces to another string. I
> can't get it to work. How do I do it? See 3 attempts below. I really do
> want multiple spaces between the startstring and the longstring.
You need to quote the argument
On Wed, Jul 2, 2025 at 1:36 PM home user via users
wrote:
>
> f42 workstation.
>
> I'm trying to prepend a string and multiple spaces to another string. I
> can't get it to work. How do I do it? See 3 attempts below. I really
> do want multiple spaces between the startstring and the longstring
Once upon a time, home user said:
> $longstring="${startstring} ${longstring}"
The leading dollar sign is your problem, you do not want that on the
left hand side of an assignment. Having $longstring on the LHS just
means it is expanded and interpreted as shell commands. You want:
longstring
Try this:
IFS='' longstring="${startstring} ${longstring}"
You can read about IFS in the bash manual:
https://www.gnu.org/software/bash/manual/bash.html
On Wed, Jul 2, 2025 at 11:36 AM home user via users
wrote:
>
> f42 workstation.
>
> I'm trying to prepend a string and multiple spaces to an
On 7/2/2025 11:49 AM, Marco Moock wrote:
On 01.07.2025 21:42 home user via users
wrote:
startstring = "11".
This is the output of an "echo"; the period is merely the end of the
output sentence.
longstring = "This is a long test string".
This is the output of an "echo"; the period is merely
On 01.07.2025 21:42 home user via users
wrote:
> startstring = "11".
>
> longstring = "This is a long test string".
> ./spaces1.bash: line 13: This: command not found
> longstring = "This is a long test string".
Which purpose do the dots have here?
--
kind regards
Marco
Send spam to abfall17
f42 workstation.
I'm trying to prepend a string and multiple spaces to another string. I
can't get it to work. How do I do it? See 3 attempts below. I really
do want multiple spaces between the startstring and the longstring.
-
me@road-runner:~$ cat spaces1.bash
#!/bin/bash
#===
16 matches
Mail list logo