08 06 | 2016

Process command line arguments in shell

Written by Tanguy

Classified in : Homepage, Debian, Command line, To remember

When writing a wrapper script, one often has to process the command line arguments to transform them according to his needs, to change some arguments, to remove or insert some, or perhaps to reorder them.

Read more Process command line arguments in shell

25 09 | 2011

Increase your productivity with two spaces

Written by Tanguy

Classified in : Homepage, Debian, Command line

Shell prompts are often designed to provide a reminder of useful context information such user name, host and current directory:

PS1="\u@\h:\w\$"
tanguy@muscat:~/public_html$

Such a prompt is sufficient to serve its original purpose, but it can be enhances in at least one useful way. Sometimes you have to copy the path of the current directory: with this prompt, it means selecting it by precisely dragging the mouse over it. Well, by adding spaces around the current directory you can become able to select it with a simple double click:

PS1="\u@\h: \w \$"
tanguy@muscat: ~/public_html $

Indeed, with such a prompt, you can now roughly point to the path, double click, and let your terminal emulator's word detection feature select the whole path for you. This simple modification may save you several tenths of seconds!

Archives