I think every linux user should at least skim through the "readline" section of the bash manpage at least once in their life to either:
validate their choice of an alternative shell, or
maybe find some helpful keybinds.


#dc comics#batman#dc#batfam#bruce wayne#dick grayson#batfamily#tim drake#dc fanart




seen from Algeria

seen from United States

seen from United Kingdom
seen from Argentina
seen from United States

seen from Malaysia

seen from United States

seen from Netherlands
seen from Mexico
seen from Argentina
seen from Belarus
seen from Japan

seen from Argentina
seen from Vietnam

seen from United States

seen from Australia
seen from China

seen from United States
seen from China
seen from Malaysia
I think every linux user should at least skim through the "readline" section of the bash manpage at least once in their life to either:
validate their choice of an alternative shell, or
maybe find some helpful keybinds.
$ i want to study at bash university
$ i will spell move as mv and use ls -al. i would watch stdout on my terminal all night while grepping with pipes. i’ll have awk and sed daily that’s worth 5 spreadsheets. i would go to man pages every night. i am also more likely to meet the sexiest fucking programmers on this god forsaken earth.
$ i wish computers used bash :(
More bash builtins stuff
Shortly after I'd written the BASH_ENABLE_ALL_LOADABLE_BUILTINS function, I thought I'd leverage the output of that to add an -l flag to the enable builtin:
I wrapped it in a function, and it outputs a columnated list with highlighting:
It's still not perfect, as I wasn't completely sure how to sort it without re-iterating over the arrays a lot, but it's at a state where it works fine, and it was a fun little exercise. I'd like to be able to put it into columns without an external command, and though that would be possible it'd add a lot more complexity to the function and it's already bloated enough looking as it is!
Configuring the Command Prompt in Mac OS X
In an earlier post, I dealt with a glitch that displayed the command prompt in the terminal as “unknown_followed_by_several_numbers.” It now shows up as the default command prompt for Mac OS X, which does the job, but one of the nice things about the Bourne Again Shell, the bit of software underlying Terminal that actually makes it do stuff, is that it’s highly customizable.
My goal here is pretty simple. I just want to modify the command prompt - that bit of text, numbers and symbols the terminal puts out to show its waiting for the user to type something.
The settings for bash are stored in a configuration file which can be edited in any text editor. Since Mac OS X is a multiuser system, this configuration file would be stored in the user’s home directory. Most UNIX systems, this file would be called .basrc. This will work in Mac OS X as well - until you log out or reboot the computer. The next time you log in or restart the system, your bash settings will be reloaded from the global configuration file, “/etc/bashrc”, completely ignoring your customized file. The only way I’ve found to make a local configuration stick under OS X is to put the setiings into ~/.bash_profile, with “~/” representing your user home directory.
So, fire up the terminal app or navigate to your home directory if Terminal is already running. Execute “nano .bash_profile” to start the nano text editor and edit the configuration file (or create it if it doesn’t exist already.)
OK, so text for our custom command prompt is stored is a setting named “PS1”, and the way to set this up in the configuration file is “PS1=”Our Custom Command Prompt.” In fact...
...you could actually just do that. Enter some plain text and go with that. But, bash also recognizes some codes for presets to include things such as date and time, user, the working directory , and for this example, I’m going to go with something more along those lines.
These codes are in the format of “\” followed by the single letter code. The slash is an escape character which tells to treat the following single character as one of its coded presets. Any text without this escape character before it is treated as plain text and will simply be added to the command prompt, as is.
I’m going to just go ahead and build my custom command prompt, then go over how it was built.
So, using nano to edit “.bash_profile”, I’m going to enter the single line:
PS1="[\d \@] \u@\h : \w $ "
Exit nano, being sure to save the file. At the command prompt, execute “source ~/.bash_profile”. After executing this command, the command prompt on my system changed to:
And, just in case that’s hard to read in the screenshot:
[Tue Oct 22 06:17 AM] oldmacnewlife@OldMacNewLifes-Power-Mac-G5 : ~ $
Let’s take another look at that setting in the bash profile.
PS1="[\d \@] \u@\h : \w $ "
Now for the blow by blow replay. That bracket at the opening of the setting string is not preceded by an escape slash, so it’s treated as plain text and added to the command prompt, as is.
The letter ‘d’ IS preceded by a slash, and it happens to be the to insert the date into the command prompt, in day, month date format.
For the sake of readability, I added a space, then a slash followed by the ampersand sign, which is the code for time, in 12 hour format followed by AM or PM as appropriate. I then added a closing bracket followed by a space to separate the date and time from the rest of the command prompt.
The “\u” is the code for the current user. And ampersand without a slash is just an ampersand. “\h” adds the hostname.
I added a colon bracketed by spaces to split off the user and hostname, then “\w”, which is the code to display the current working directory. One more space, then the dollar sign for the traditional Unix prompt.
So, I’m calling this done. You can find the complete list of command prompt options, along with the full bash manual at:
https://www.gnu.org/software/bash/manual/html_node/Controlling-the-Prompt.html#Controlling-the-Prompt
Correlation of Bug Between BASH and Security Suites
I’m looking for bash projects, anybody got some cool ideas?
Faille bash, encore un patch...
Faille bash, encore un patch…
Bug-Reported-by: Michal Zalewski <[email protected]> Bug-Reference-ID: Bug-Reference-URL: Bug-Description: A combination of nested command substitutions and function importing from the environment can cause bash to execute code appearing in the environment variable value following the function definition.
Bla bla bla, encore une nouvelle version de batch patchée pour des versions qui…
View On WordPress
Bash Emacs Editing Mode Cheat Sheet