True, however the OP might not know what he/she does not know. Many folks seem to assume "boot" is a monolithic single item, that occurs right after they apply power, such that you can turn it on then do stuff, any stuff. The standard trap is trying to run something that requires networking be up.The question was 'run a bash script at startup'. Both those two above do exactly that. If you want something more complicated than 'run a shell script at startup', then perhaps you need to do something else, but those answers are entirely correct for OP's question.
Given that, providing the standard gottchas is a nice thing to do, and avoids the almost inevitable "it does not work" loop, after they run a script without any error handling and logging that requires "stuff" to be functional for success. Similar in concept to always suggesting redirecting stdout and stderr to something useful/appropriate for cron entries.
Otherwise many answers can be boiled down to "yes", "no", or a terse Linux command, which likely will not be helpful since many of the simple questions have very simple and obvious answers, if you have the appropriate knowledge.
I fully acknowledge that that means more typing and also falls into the trap of assuming little/no knowledge on the part of the OP, which leads you down asking "is it turned on" types of questions, rather than directly answering the question being posed. My assumption is if the question appears basic, and is not conditionally qualified, that the skill set is also basic and needs a more detailed answer to be useful.
Statistics: Posted by bjtheone — Fri Jan 26, 2024 4:19 pm