Translate

Image of Linux Kernel Development (3rd Edition)
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)
Image of Beginning Google Maps API 3
Image of Android Wireless Application Development

Bash-like Customizable Prompt in Korn Shell

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.

Dynamically Updating Xterm Title using Ksh93

In this post, I show you how to use a discipline function dynamically customize the title of your xterm window and your shell prompt

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

The Time Keyword in Bash

The word time is one of the bash shell reserved words. It is not a bash shell builtin. $ builtin time bash: builtin: time: not a shell builtin Bash does support the older Bourne shell keyword times as a builtin. This builtin prints out the user and system times used by the shell and its children. So where is the time reserved word used in the bash shell? It is primarily intended for printing pipeline timing statistics. From the current online bash documentation: The format for a pipeline is [time [-p]] [!] command1 [| command2 …] The output of each

Korn Shell DEBUG Trap

The trap shell builtin is used to change the way signals are handled by the Korn Shell 93 (ksh93) shell. In addition, a trap may be set for three ksh93 pseudo-signals: EXIT, ERR, and DEBUG. In this post we demonstrate how to use the DEBUG pseudo-signal to trap changes in the value of a variable for debugging purposes. trap [ -p ] [ action ] [ sig ] . . . The -p option causes the trap action associated with each trap as specified by the arguments to be printed with appropriate quoting. Otherwise, action will be processed as if