6 ms·
The bash book to rule them all
- goimonkeen 3y ago[flagged]
- deleted 3y ago[deleted]
- a_bonobo 3y agoI usually recommend Data Science At The Command Line https://jeroenjanssens.com/dsatcl/ https://jeroenjanssens.com/dsatcl/ Not because it explains bash well, but because it fits with my data science/bioinformatics niche. It's all about these funky sort/uniq/rev/cut/uniq/awk/wc/sed patterns I use everyday fiddling with csv files.
- asicsp 3y agoI've written books for GNU grep, sed, awk as well as one for coreutils. Free to read online. See https://github.com/learnbyexample/scripting_course#ebooks https://github.com/learnbyexample/scripting_course#ebooks for links. Have you looked at https://github.com/BurntSushi/xsv https://github.com/BurntSushi/xsv for csv processing?
- zaptheimpaler 3y agoHi, the part about bioinformatics caught my eye. Im a software engineer wanting to move into bioinformatics or somewhere between bio+CS. If you're up for it, can i email/DM you somewhere? Just want to learn more about what the industry is like, projects or ideas to break into the field etc. My email is also on my profile.
- ceuk 3y agoIt was the second question that convinced me to buy it.
- codetrotter 3y agoThat’s a legitimate reason :D I think the pretty animal illustrations is what initially caught my attention and helped me discover O’Reilly as a publisher to pay specific attention to in IT books. The animals trick you into opening their books, and the texts usually have you continue reading.
- codetrotter 3y ago> You want to understand why cd is not an executable but a builtin? Because a sub-process cannot change the working directory of its parent. The shell process needs to change its own working directory. Therefore cd must be a builtin. Although, I suppose that one might execve a cd binary, which would change directory and then in turn the cd binary would execve the shell that is specified in the $SHELL env var. That would be terribly silly though :p
- neuromanser 3y agohttps://www.skarnet.org/software/execline/execline-cd.html https://www.skarnet.org/software/execline/execline-cd.html
- happymellon 3y agoI believe it's been posted here before, but I also use this for reference whenever I forget the syntax to something, or know there must be a better way than what I am doing. https://github.com/dylanaraps/pure-bash-bible https://github.com/dylanaraps/pure-bash-bible
- ndsipa_pomu 3y agoDon't forget about Greg's Wiki https://mywiki.wooledge.org/BashFAQ https://mywiki.wooledge.org/BashFAQ (and of course we're all using ShellCheck to check our scripts for common mistakes)
- zwischenzug 3y agoThe only way to learn bash ;-) https://leanpub.com/learnbashthehardway https://leanpub.com/learnbashthehardway
- traceroute66 3y agoControversial perhaps, but I now use Go where I used to be a prolific shell script script coder. Main reasons: - Fewer opportunities for foot-guns - Ease of portability, no dependencies, e.g. no more "is jq installed ?" - Consistent cross-platforms, e.g. no more "is this system using GNU sed ?" - Modern stuff like crypto, and "internet stuff" is just quicker and easier to do in Go.
- frizlab 3y agoEven more controversial, I use Swift.
- jalino23 3y agoswift is so nice to code with
- unixhero 3y agoSwift for system operations?
- frizlab 3y agoI have a sh*ton of conveniences that make it good. Using Foundation only would be a pain indeed (for now; they are rewriting Foundation in Swift with better APIs, so it might get better).
- kreetx 3y agoJust as controversial, I use Haskell. Everything has a type, no more interpolation foot-guns, etc. And it pays off in slowly building a library on top. (Much if not all of it applies to Swift as well I believe.)
- LucasLarson 3y ago> slowly building a library on top What does this part mean?
- 3y ago
- khrbtxyz 3y ago$ uname Darwin $ which cd /usr/bin/cd
- traceroute66 3y agoHuh ? Which OS X are you on ? What you posted is not reproducable on Ventura (13.6) % uname Darwin % which cd cd: shell built-in command
- irishsultan 3y agoDepends on your shell, if you execute `which -a cd` it will show you /usr/bin/cd in addition to the built-in command. (zsh has which as a built in command, apparently bash doesn't, which causes the different output). It's unclear to me what /usr/bin/cd actually accomplishes though, even in bash. (final edit I hope, I found an explanation of sorts for /usr/bin/cd: https://unix.stackexchange.com/a/50060 https://unix.stackexchange.com/a/50060)
- traceroute66 3y ago> It's unclear to me what /usr/bin/cd actually accomplishes though, even in bash. Seems to be something they adopted from FreeBSD if the comment in the script is anything to go by ? (`/usr/bin/cd` is a shell script, you can cat it). It seems something to do with it being a POSIX system if this SO answer[1] is anything to go by. Beyond my paygrade though, and given Apple's shell appears to default to the built-in it seems I don't need to care either. :-) [1] https://unix.stackexchange.com/questions/50022/why-cant-i-redirect-a-path-name-output-from-one-command-to-cd/50025#50025 https://unix.stackexchange.com/questions/50022/why-cant-i-re...
- khrbtxyz 3y agoI’m on Ventura 13.6.1. Looks like your which is a shell built-in as well. Try ls /usr/bin/cd
- deleted 3y ago[deleted]
- fsckboy 3y agoThe title of the book (perhaps a more useful title) is Efficient Linux at the Command Line: Boost Your Command-Line Skills by Daniel J. Barrett 2022 perhaps the book should be called Efficient Bash at the Command Line: Boost Your Linux Skills. It has a little table at the end that says "if you use a different shell". Not sure if this type thing suffuses the book a tall
- firexcy 3y agoFor such nuances I keep this page handy: https://hyperpolyglot.org/unix-shells https://hyperpolyglot.org/unix-shells
- jackhalford 3y agoOk this may be a little over the top but in my experience there’s a better way to learn bash: implement bash. I did this for a school project, along with job control, pipes, redirects, builtins. All of the trip ups mentionned in this article will become obvious.
- wkjagt 3y agoThis is good advice. Whenever I'm trying to recreate something that exists, I often run into what feels like forced decisions that make my reimplementation closer to the original. And then some seemingly random thing in the original becomes logical.
- osxman 3y agoThanks for the article! Might want to check 'Small, Sharp Software Tools' from The Pragmatic Programmers also. It's a great book, and comparable to the O’Reilly book. https://pragprog.com/titles/bhcldev/small-sharp-software-tools/ https://pragprog.com/titles/bhcldev/small-sharp-software-too...
- elzbardico 3y agoIncidentally this is why I think an O'Reilly is one of the most cost-effective subscriptions that I pay. It is not cheap, for sure, but I can find most book recommendations like this on it.
- Breza 3y agoAlso worth checking your public library to see if they're already paying for you to have a subscription. The DC Public Library offers it here.
- dbauthor 3y agoThanks so much your book review, Fabien! I wrote "Efficient Linux at the Command Line" because I kept meeting Linux/Unix users (over the past 30 years) who had learned the command line mostly by trial and error. They could use Linux OK for their jobs, but they didn't know the underlying concepts and had all sorts of inefficiencies or superstitions. I'd spend a few minutes with these users, and their speed at the command line would literally double, just from showing them job control, CDPATH, the directory stack, and other features they'd missed. I'm glad you enjoyed the book.