Earlier quoted context omitted.
Can you explain why?
Not all systems have bash.
Things I Wish I'd Known About Bash
51–60 of 272 posts
Re: Things I Wish I'd Known About Bash
#52My favourite little-known readline command is operate-and-get-next:
https://www.gnu.org/software/bash/manual/html_node/Miscellan...
You can use it to search back in history with C-r and then execute that command with C-o and keep pressing C-o to execute the commands that followed that one in history. Very helpful for executing a whole block of history.
For some reason, this documentation is hard to find! It's not here, for example:
http://readline.kablamo.org/emacs.html
I'm a bit saddened when readline replacements don't implement C-o. For example, the Python REPLs don't have it.
Re: Things I Wish I'd Known About Bash
#53#0: If you're writing scripts that are destined for other users, use POSIX sh instead.
Re: Things I Wish I'd Known About Bash
#54Earlier quoted context omitted.
Which is why the parent advised to treat the man page like a reference document, by searching in it. Some man pages are just badly written and are indigestible even when searching for a specific thing, but in general, that approach works quite often.
Is there some trick to searching man pages that I don’t know? Because my usual experience is: type man foo type /-p type n n n n n n n n n as there are a bunch of matches like “...does bar when combined with -p...” A presentation of man pages that used hypertext would make me a lot happier.
/ -pRe: Things I Wish I'd Known About Bash
#55Two important things missing: 1) This is a huge pet peeve of mine, but it kills me when my coworkers "bash" emacs and sing the praise of vim, then proceed to explain to me that ctrl-R in bash searches for the last command with a given pattern. They also often refuse to believe me that they're basically using emacs controls (because you know emacs' dirty). So, please, if you're in love with vim and use ksh or bash, le…
But not well implemented! You're supposed to be able to edit your search string, and I've never found a way.
Re: Things I Wish I'd Known About Bash
#56Re: Things I Wish I'd Known About Bash
#57+1 for the parts that are portable to Bourne shell/ksh/zsh. -1000 for the parts that are specific to Bash. Stuff like that has been huge pain in my ass over the years. Some clever programmer uses some bash-ism and the build breaks on some ancient hardware that doesn't have bash. I realize my complaint sounds like Henry Spencer's Ten Commandments and perhaps it feels outdated but trust me, you don't want to wade into…
The article doesn't mention which are portable and which aren't.
A POSIX (or older Bourne-descended) shell can be distinguished from ‘bash --posix’ in a script with a fragment like “date&>F”, because Bash authors either didn't realize or didn't care that the sequence ‘&>’ already had meaning.
Re: Things I Wish I'd Known About Bash
#58Earlier quoted context omitted.
Exactly: GNU bash is on most GNU/Linux systems, but: * mac OS uses an ancient version of bash * Embedded systems use busybox sh * Android uses its own version of sh * None of the BSDs come with bash, since, y'know GNU licensing EDIT: Formatting
And to make things interesting Ubuntu uses dash as sh https://wiki.ubuntu.com/DashAsBinSh
Re: Things I Wish I'd Known About Bash
#59Re: Things I Wish I'd Known About Bash
#60Two important things missing: 1) This is a huge pet peeve of mine, but it kills me when my coworkers "bash" emacs and sing the praise of vim, then proceed to explain to me that ctrl-R in bash searches for the last command with a given pattern. They also often refuse to believe me that they're basically using emacs controls (because you know emacs' dirty). So, please, if you're in love with vim and use ksh or bash, le…
> they're basically using emacs controls But not well implemented! You're supposed to be able to edit your search string, and I've never found a way.