Language Selection

English French German Italian Portuguese Spanish

A Sample Function inline with Bashprompt

Filed under
HowTos

The bash prompt has built in commands that use escape charachter syntax. By default a lot of packages ship bash with a default that shows the hostname and relative path. The escape sequences for all users is usually kept in /etc/bashrc or a similar system location. The sequences themselves might look something like this:
PS1="[\u@\h:\w]\$

The above settings would look like:
[username@hostname:current_working_directory]$

Or a real example:
[jrf@vela:~/www/systhread.net/texts]$

As noted in theBash Prompt HOWTO commands can be executed everytime the RETURN sequence is sent to the shell interpreter. For this example the Bash Prmpt HOWTO provides ample demonstration of some commands:

More Here




More in Tux Machines

The Companies That Support Linux: MariaDB

MariaDB Corporation is a provider of open source database solutions for SaaS, cloud and on-premise applications that require high availability, scalability, and performance. Built by the founder and core engineering team behind MySQL, MariaDB has more than 2 million users globally and over 500 customers in more than 45 countries -- most of whom are running Linux. Read more

UK health service nurtures open source communities

The UK’s National Health Service (NHS) is nurturing a growing number of communities of software developers working on open source solutions. NHS’ Code4Health team is now supporting 17 communities that bring together health care providers, developers and supporters. Read more

LG's got a flip phone that runs Android Lollipop

Flip phones aren't just for retro hipsters and the elderly anymore... well, actually they kind of are. But they're super popular in Asia, and now you can get one that'll run the latest apps: LG's Gentle flip phone. The faux-leather adorned device is running a bleeding edge version of Android 5.1 Lollipop and packing 4G LTE. Otherwise, it's not exactly a power-user's dream with a 3.2-inch 480 x 320 screen, 3-megapixel rear camera, 4GB of (expandable) storage and 1GB of RAM. But for just 20 million won ($175) it would make a fine second phone, provided you live in Korea -- it's unlikely to come here, and similar flip phones can be pricey to import. Read more

Next-gen Android One phone launches in India for $176

The Lava Pixel V1 offers a solid value for the price, combining mid-range hardware with the latest Android software updates from Google. Read more