LinuxCommandLibrary

grub-script-check

validate GRUB configuration script syntax

TLDR

Check a GRUB script file for syntax errors

$ grub-script-check [path/to/grub.cfg]
copy
Display each line of input after reading (verbose)
$ grub-script-check -v [path/to/grub.cfg]
copy
Check script from stdin
$ cat [path/to/script] | grub-script-check
copy
Display help
$ grub-script-check --help
copy

SYNOPSIS

grub-script-check [options] [file]

DESCRIPTION

grub-script-check validates GRUB configuration scripts for syntax errors. It parses the GRUB scripting language used in configuration files like grub.cfg and reports any syntax problems.
If no file path is provided, the tool reads from standard input. This is useful for validating generated configurations or testing script fragments before deployment.

PARAMETERS

-v, --verbose

Display each line of input after reading it
--help
Display help message
--version
Display version information

CAVEATS

Only checks syntax, not semantic correctness. Valid syntax doesn't guarantee the configuration will boot properly. Cannot verify that referenced files or modules exist.

HISTORY

grub-script-check is part of GRUB 2, providing validation for GRUB's configuration scripting language. The scripting capability was introduced in GRUB 2 to replace the simpler configuration format of GRUB Legacy.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community