This post discusses and demonstrates how to use the printf %T date functionality available in the Bash shell since version 4.2.
|
||
This post discusses and demonstrates how to use the printf %T date functionality available in the Bash shell since version 4.2. This post discusses various issues, workarounds and solutions to printing details of arguments (AKA positional parameters) passed to shell scripts via the command line upon invocation of the shell script. Bash has built-in support for extensive PS1 prompt customization and as a result many people customize their shell prompts. There is no equivalent built-in support for PS1 customization in ksh93 but such support can easily be added using discipline functions. In this post, I show you how to create a Korn Shell launcher for the new Windows Subsystem for Linux. 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 |
||
Copyright © 2007-2024 Finnbarr P. Murphy. All Rights Reserved |