See the blurb on the book here: Blurb link
There will be a blog here describing the arduous climb up Mt.Publish.
Please check back in February or March... or see below for University speaking engagements, if you cannot wait that long.
...also under construction
Here is a small shell script which looks at the grub configuration file and tells you what your boot menu should look like. If you have made custom changes to your boot menu, the script should tell you how well you did. Importantly, there are explanations of what is going on in every phrase of the script.
The explanations will help you understand what some of the built-in functions in the bash shell can do to make your life easier. Plus, you will have a useful utility handy to check whether your grub menu update went as planned.
Here are the interesting details:
cat is a built-in GNU/Linux program which concatenates the files listed on the command line and sends the output to the terminal. So, if your command line says cat /boot/grub/grub.cfg then the contents of the grub configuration file will be printed to the screen.
grep is a filtering program. As lines are read from a file, if your filter word appears in the line, the line will be printed on the terminal. If your filter word does not appear in the line, the line is ignored. grep will also read from the keyboard if you do not specify a file.
Now, as your command line shows cat /boot/grub/grub.cfg | grep menuentry, then the terminal screen should show you all the lines of the grub configuration file which contain the word 'menuentry'. (The vertical line before grep is called the "pipe", and it takes the output of the actions to its left and applies it as the input to the command on its right.)
Type that command into a terminal; you will see that displaying the entire line is not desirable. A way to just look at the information between the single quotes would be helpful. Let's look at the cut command. If you specify the single quote as a field delimiter, your command will look like this: cat /boot/grub/grub.cfg | grep menuentry | cut -d "'" -f 2. The "-f 2" means that we want the second field - the first field is everything from the beginning of the line until the first delimiter (the single quote). The second field will be the contents of the line between the first single quote and the second one.
One more silly problem exists. There are more lines of information coming through the grep filter. Try the command for yourself:
cat /boot/grub/grub.cfg | grep menuentry | cut -d "'" -f 2
You really don't need any lines with "menuentry_id". Notice that changing the filter to 'menuentry ' (see the space before the close quote) will display all the lines we want and none of the lines we do not want.
Now, you have all of the menu items including the advanced options. This is because all the main menu entries begin at the left edge of the line. All the "advanced" entries are indented. Changing our filter to '^menuentry ' will pass through all the lines which have the word at the beginning of the line. That caret at the beginning of the filter word means we only want the lines with "menuentry" at the beginning of the line.
So here is the complete script. Included are "if...then" logic switches so that the user can specify "advanced" or "main only" menu entries. With nothing on the command line, the "main" menu items will be displayed. With "-a" on the command line, the "advanced" menu entries will be diplayed. Anything else on the command line (such as "--help") will display the usage hints.
The "if" syntax for bash scripts is simple, but all the different TEST phrases are hard to remember. Keep a copy of the "abs-guide" handy.
To grab the script above, put the mouse in the script area, right-click and select "select all", right click again and select "copy". Open a text editor window and paste the script text into it. Save the script with an appropriate filename ("viewboots.sh" ?) in an appropriate location ($HOME/bin/ ?). And Bob's yer uncle.