Tag Archives: gossip

Error when Linux executes sh script: syntax error: bad FD number

Today, when using the WCET analyzed by Chronos, there is an error:

: Syntax error: Bad fd number

This error occurs when executing the SH script and when opening the file
solution:
after consulting the data, it is possible that SH is linked to dash rather than bash, so you only need to check the link
execute command

ls -l /bin/sh

Results:

if the above results are obtained, continue to execute the command:

sudo mv /bin/sh /bin/sh.orig
sudo ln -s /bin/bash /bin/sh

Check again and you should get the correct results

Solutions to the problem that CodeBlocks cannot be used

It is possible to fail to run on newly installed codeblocks and
with the following error message
“HelloWord – Debug” : The compiler’s setup (GNU GCC compiler) is invalid, so Code::Blocks cannot find/run The compiler.
Probably The toolchain path within The compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto “Settings – & gt; The Compiler… -> Global compiler settings-> GNU GCC Compiler-> Toolchain executables “and fix the compiler’s setup.
Nothing to be done (all items are up-to-date).
This is simply a missing configuration file or the wrong location of the root directory of the configuration file
Open Settings-> when prompted; The Compiler… -> Global compiler settings-> GNU GCC Compiler-> Toolchain executables

We can see that the default directory address is C:\MinGW
The following prompt cannot be found
If there is no MinGW in this file
download address: click enter
It is generally best to unzip to the root directory of codeblocks

Then in
Settings->; The Compiler… -> Global compiler settings-> GNU GCC Compiler-> Toolchain executables
To change the root address I have D:\codeblocks\MinGW
Then running the program is no problem