2023-11-09 01:43 AM
What shell is used to execute pre- and post-build steps in CubeIDE? It seems to be different to my system shell.
I have a pre-build (bash) script that I want to run automatically before each build. I've added the line to execute it to the projects Properties/C/C++ Build/Settings/Build steps. The script is only one line, namely:
This error basically says that the awk version does not support the -i inplace option, so the version is older. If I remove the option, the file isn't edited in place but printed to the terminal, and the command works as expected (also in CubeIDE). When I launch a command shell console from CubeIDE however, and check the version of awk it is the same as my system version. It seems to me that the pre-build step is executed in a different shell enviroment.
Solved! Go to Solution.
2023-11-09 01:54 PM - edited 2023-11-09 02:00 PM
On Windows it is a busybox bundled with the CubeIDE host utilities, with "dash" shell and usual set of commands (awk among them). But these utilities in busybox are limited versions, compared to full-size linux. Adapt your script to the limitations, or get a newer/better busybox, or use external package of GNU utilities (Cygwin?)
2023-11-09 09:22 AM
Don't know what shell or what version, though I suspect it is some form of "sh".
Regardless, can you change your script to explicitly run a shell/environment that has your desired version of awk?
2023-11-09 01:54 PM - edited 2023-11-09 02:00 PM
On Windows it is a busybox bundled with the CubeIDE host utilities, with "dash" shell and usual set of commands (awk among them). But these utilities in busybox are limited versions, compared to full-size linux. Adapt your script to the limitations, or get a newer/better busybox, or use external package of GNU utilities (Cygwin?)