-1

If I were to have a script that will only, or I only want to run on devices with a specific kernel, could I possibly use a command or function to check if the correct version is present before continuing? Could it really be as simple as using regular expression with -r?

Thanks for any ideas!

EDIT:

Maybe my post wasn't worded the best. Is there a way to verify the kernel is indeed the correct one before proceeding with the REST of the script else it stops running?

  • Possible duplicate of [Best way to find os name and version in Unix/Linux platform](https://stackoverflow.com/q/26988262/608639), [How do I identify the particular Linux flavor via command line?](https://stackoverflow.com/q/13036048/608639), [How to discover what Linux distribution is in use](https://stackoverflow.com/q/264290/608639), etc. – jww Oct 13 '18 at 04:50

1 Answers1

1

I'd suggest the uname command, in particular then try uname -r.

JustAnotherCoder
  • 368
  • 1
  • 2
  • 10