jrweber
February 26, 2025, 6:28am
1
Hi,
When I run the wycked command, I get the following error:
example:
> wycked 176 abc
#const a=; c=;
{a} {a} {c} {90} {90} {120}
1 0 0
0 1 0
0 0 1
#const …wycked: line 62: ${site}=“${site^}”;: bad substitution
It seems to be crashing on this line:
echo ${site}=“${site^}”;
Any ideas on what might be causing this? Thanks a lot. - Justin
jrweber
February 27, 2025, 6:11am
2
It works! Thanks a lot. - Justin
avdw
February 27, 2025, 4:45pm
3
try changing the 1st line of the script to
#!/bin/bash
Let me know if this works!
jrweber
February 27, 2025, 4:51pm
4
Opening wycked , I see that it already started with:
#!/bin/bash
I tried changing it to:
#!/bin/sh
But I get the same error. Thanks. - Justin
avdw
February 27, 2025, 4:57pm
5
Sorry - I didn’t realized I had fixed that part in the distribution already.
Now try (on the command line, assuming you are running bash, otherwise first type bash):
site=dummy
echo ${site}=\"${site^}\"\;
echo ${site}=\"${site^}\"
echo ${site}=\"${site^?}\"
echo ${site}=${site^}
echo ${site}=${site}
echo ${site}
echo $site
jrweber
February 27, 2025, 5:03pm
6
I get:
> site=dummy
> echo {site}=\" {site^}";
bash: {site}=\" {site^}";: bad substitution
> echo {site}=\" {site^}"
bash: {site}=\" {site^}": bad substitution
> echo {site}=\" {site^?}"
bash: {site}=\" {site^?}": bad substitution
> echo {site}= {site^}
bash: {site}= {site^}: bad substitution
> echo {site}= {site}
dummy=dummy
> echo ${site}
dummy
> echo $site
dummy
Thanks for the education here. I assume I should just change that line to:
echo {site}= {site}
Let me know if this is not correct. Thanks a lot. - Justin
avdw
February 27, 2025, 5:06pm
7
Ok then, just replace
site^
BY:
site
The only negative consequence is that the site name in quotes in the output won’t be capitalized. No big deal. Apparently the "^" syntax only works for bash 4.0 and above…
A better fix: change:
echo ${site}=\"${site^}\"\;
to
echo ${site} | awk '{print $1"=\"" toupper($1) "\";"}'
I’ll include that in the next version.
-Axel