Android Backstage, a podcast by and for Android developers. Hosted by developers from the Android engineering team, this show covers topics of interest to Android programmers, with in-depth discussions and interviews with engineers on the Android team at Google. Subscribe to Android Developers YouTube → https://goo.gle/AndroidDevs
…
continue reading
Content provided by HPR Volunteer and Hacker Public Radio. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by HPR Volunteer and Hacker Public Radio or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!
Go offline with the Player FM app!
HPR2349: Customizing my bash prompt
MP3•Episode home
Manage episode 446211242 series 2795599
Content provided by HPR Volunteer and Hacker Public Radio. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by HPR Volunteer and Hacker Public Radio or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
Basic bash prompt information Variables and files .bashrc: the RC file where all of this stuff can be set PS1: main prompt variable PS2: continuation prompt PROMPT_COMMAND: a bash function name, run every time prompt is displayed Colors Uses escape sequences There are problems with prompts and escape sequences Multiple escaping String interpretation and variable expansion tput to the rescue! Takes away the need for complex escape codes Must run tput init at the beginning of your .bashrc file TL;DR: Use tput for color strings, add them at the last possible moment, with brackets and backslashes Embedding bash scripts Single quotes are king Will be run every time PS1 is evaluated Otherwise, only run at time of assignment Layout of my prompt Two lines Information/status line Prompt line Status line Starts with current username Changes color when user has mail Next is the hostname (truncated) Separated by an @ symbol, like an email address Changes color when the system is in need of a reboot Checks for /run/reboot_required Current directory Separated from previous items by a pipe Truncated with a tilde if user's home is in the path Prepended with a number indicating the directory stack, if present Appended with the git (±) symbol if we're in a git branch, followed by the name of the branch Prompt line A blue » character Prepended with the number of background processes spawned from this terminal Screenshot: Link to Git Repository https://gitlab.com/windigo-configs/bash.git Editor's Note: added 2017-08-05
…
continue reading
116 episodes
MP3•Episode home
Manage episode 446211242 series 2795599
Content provided by HPR Volunteer and Hacker Public Radio. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by HPR Volunteer and Hacker Public Radio or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://ppacc.player.fm/legal.
Basic bash prompt information Variables and files .bashrc: the RC file where all of this stuff can be set PS1: main prompt variable PS2: continuation prompt PROMPT_COMMAND: a bash function name, run every time prompt is displayed Colors Uses escape sequences There are problems with prompts and escape sequences Multiple escaping String interpretation and variable expansion tput to the rescue! Takes away the need for complex escape codes Must run tput init at the beginning of your .bashrc file TL;DR: Use tput for color strings, add them at the last possible moment, with brackets and backslashes Embedding bash scripts Single quotes are king Will be run every time PS1 is evaluated Otherwise, only run at time of assignment Layout of my prompt Two lines Information/status line Prompt line Status line Starts with current username Changes color when user has mail Next is the hostname (truncated) Separated by an @ symbol, like an email address Changes color when the system is in need of a reboot Checks for /run/reboot_required Current directory Separated from previous items by a pipe Truncated with a tilde if user's home is in the path Prepended with a number indicating the directory stack, if present Appended with the git (±) symbol if we're in a git branch, followed by the name of the branch Prompt line A blue » character Prepended with the number of background processes spawned from this terminal Screenshot: Link to Git Repository https://gitlab.com/windigo-configs/bash.git Editor's Note: added 2017-08-05
…
continue reading
116 episodes
All episodes
×Welcome to Player FM!
Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.