Translate

Archives

Zero Padding Brace Expansions in the Korn Shell

Both bash and zsh shells support leading zeros in ranges: $ echo {1..10} 1 2 3 4 5 6 7 8 9 10 $ echo {01..10} 01 02 03 04 05 06 07 08 09 10 $ echo {001..010} 001 002 003 004 005 006 007 008 009 010 $ From the bash manpage section on brace expansion: Supplied integers may be prefixed with 0 to force each term to have the same width. When either x or y begins with a zero, the shell attempts to force all generated terms to contain the same number of digits, zero-padding where

Access BGRT Information and Boot Graphics From UEFI Shell

In this post, I provide the source code for a small UEFI shell utility which will display information about a ACPI 5.0 BGRT table, if present, and allow you to save the referenced boot logo as a BMP file.

Sudo and Globbing

The question is how we can use the sudo utility to display a list of files in a directory to which we have absolutely no Unix filesystem privileges Consider the following directory and files contained therein: $ ls -l total 4 drwxrwx—. 2 root root 4096 May 22 21:14 demo $ su Password: XXXXXXXX # ls -l demo total 0 -rw-r–r–. 1 root root 0 May 22 21:14 file1 -rw-r–r–. 1 root root 0 May 22 21:14 file2 -rw-r–r–. 1 root root 0 May 22 21:14 file3 # exit exit Note the directory permissions are 770 and the user and

Check Available Text and Graphic Modes From UEFI Shell

This post provides source code for a simple UEFI shell utility to list the available graphic and text modes for the current screen.

Case Insensitive File Listings

In general, Linux filenames are case-sensitive. So how case you list the files in your current directory in a case-insensitive way? Technically, you are looking to perform case-insensitive globbing. Here are some ways: # touch DEMO demo DeMo # ls -l [Dd][Ee][Mm][Oo] -rw-r–r–. 1 root root 0 Mar 24 11:39 demo -rw-r–r–. 1 root root 0 Mar 24 11:39 DeMo -rw-r–r–. 1 root root 0 Mar 24 11:39 DEMO # ls -l | grep -i demo -rw-r–r–. 1 root root 0 Mar 24 11:39 demo -rw-r–r–. 1 root root 0 Mar 24 11:39 DeMo -rw-r–r–. 1 root root 0 Mar