Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Advanced Bash-Scripting GuideMendel Cooper

    Advanced Bash-Scripting Guide

    Mendel Cooper · 2014

    Summary This comprehensive and authoritative book about bash programming is a must-have book for any Linux/Unix professionals. It is both a tutorial and a reference on shell scripting with Bash.It assumes no previous knowledge of scripting or programming, but progresses rapidly toward an intermediate/advanced level of instruction... all the while sneaking in little nuggets of UNIX® wisdom and lore. It serves as a textbook, a manual for self-study, and as a reference and source of knowledge on shell scripting techniques. The exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really learn scripting is to write scripts. This book is suitable for classroom use as a general introduction to programming concepts. Notes: this book has been splited into Volume 1 and Volume 2.Volume 1 contains all content except appdendixes. ( ) Volume 2 contains all appdendixes. ( Table of Contents of Volume 1 Part 1. Introduction 1. Shell Programming! 2. Starting Off With a Sha-Bang Part 2. Basics 3. Special Characters 4. Introduction to Variables and Parameters 5. Quoting 6. Exit and Exit Status 7. Tests 8. Operations and Related Topics Part 3. Beyond the Basics 9. Another Look at Variables 10. Manipulating Variables 11. Loops and Branches 12. Command Substitution 13. Arithmetic Expansion 14. Recess Time Part 4. Commands 15. Internal Commands and Builtins 16. External Filters, Programs and Commands 17.

    Programming
    Open Library
    Stats for nerds
    16recommend
    33mentions
    30people
    2011–2026years
    58% recommend24% neutral18% critical

    Mentions per year

    201120132015201720192021202320252026

    What Hacker News says

    1. teddyhNov 2023
      I dutifully refer you to the ancient texts:

      Advanced Bash-Scripting Guide <https://tldp.org/LDP/abs/html/abs-guide.html>

      Bash Guide for Beginners <https://tldp.org/LDP/Bash-Beginners-Guide/html/Bash-Beginner...>

      thread
    2. getoffmyyawnFeb 2023
      For those looking for learning resources, here are some I've found useful:

      The Advanced Bash Scripting Guide[0]

      Classic Shell Scripting[1]

      Google Shell Style Guide[2]

      Wicked Cool Shell Scripts[3]

      GNU Bash Manual[4]

      0. https://tldp.org/LDP/abs/html/

      1. https://www.goodreads.com/book/show/299533.Classic_Shell_Scr...

      2. https://google.github.io/styleguide/shellguide.html

      3. https://nostarch.com/wcss2

      4. https://www.gnu.org/software/bash/manual/

      thread
    3. npongratzNov 2021
      The Advanced Bash-Scripting Guide also has some (IMO) good advice, with a footnoted mention of sysexits.h: https://tldp.org/LDP/abs/html/exitcodes.html

      > The author of this document proposes restricting user-defined exit codes to the range 64 - 113 (in addition to 0, for success), to conform with the C/C++ standard. This would allot 50 valid codes, and make troubleshooting scripts more straightforward.[2]

      > ...

      > [2] An update of /usr/include/sysexits.h allocates previously unused exit codes from 64 - 78. It may be anticipated that the range of unallotted exit codes will be further restricted in the future. The author of this document will not do fixups on the scripting examples to conform to the changing standard. This should not cause any problems, since there is no overlap or conflict in usage of exit codes between compiled C/C++ binaries and shell scripts.

      thread
    4. tristorSep 2021
      I don't have any one complete book that I can recommend, and I don't even really have a great reading list for this. But I'll make an attempt to share what I think is useful as a starting point.

      1. Systems Operations is first and foremost about understanding systems, in all of their complexity, which means understanding the internals of your OS primarily.

      2. Performance and networking, in particular, are super important areas to focus on understanding when it comes to learning the topic to help with software development.

      3. A lot of it is about understanding concepts in abstract and being able to extrapolate to other situations and apply these concepts, so there's actually quite a lot of useful information that can be learned on one OS and still applied to another OS (or on one game engine and applied to another, et al).

      Here's a few books I think are worth reading, not in any particular order of prevalence, but loosely categorized

      Databases:

      High Performance MySQL: https://www.amazon.com/gp/product/1449314287/

      SQL Queries for Mere Mortals: https://www.amazon.com/gp/product/0321992474/

      The Art of SQL: https://www.amazon.com/gp/product/0596008945/

      Networking:

      TCP/IP Illustrated: https://www.amazon.com/exec/obidos/ISBN=0201633469/wrichards... (updates on author's site at http://www.kohala.com/start/tcpipiv1.html)

      The TCP/IP Guide: https://www.amazon.com/TCP-Guide-Comprehensive-Illustrated-P...

      UNIX Network Programming: https://www.amazon.com/dp/0131411551

      Beej's Guide to Network Programming: http://beej.us/guide/bgnet/

      Operating Systems:

      Operating Systems Concepts: https://www.amazon.com/Operating-System-Concepts-Abraham-Sil... (various editions, I have the 7th edition... I recommend you find the latest)

      Modern Operating Systems: https://www.amazon.com/Modern-Operating-Systems-Andrew-Tanen... (the "Tanenbaum Book")

      Operating Systems Design and Implementation: https://www.amazon.com/Operating-Systems-Design-Implementat-... (the other one, the "MINIX Book")

      Windows Internals:

      Part 1: https://www.amazon.com/Windows-Internals-Part-architecture-m...

      Part 2: https://www.amazon.com/Windows-Internals-Part-2-7th/dp/01354... (I had the pleasure of being taught from this book by Mark Russinovich and David Solomon at a previous employer, was an amazing class and these books are incredible resources even applied outside of Windows, we used 5th edition, I linked 7th, which has the 2nd part pending publication).

      MacOS Internals:

      Part 1: https://www.amazon.com/MacOS-iOS-Internals-User-Mode/dp/0991...

      Part 2: https://www.amazon.com/MacOS-iOS-Internals-II-Kernel/dp/0991...

      Part 3: https://www.amazon.com/MacOS-iOS-Internals-III-Insecurity/dp...

      Linux Kernel Programming:

      Part 1: https://www.amazon.com/Linux-Kernel-Development-Cookbook-pro...

      Part 2: https://www.amazon.com/Linux-Kernel-Programming-Part-Synchro...

      The Linux Programming Interface: https://www.amazon.com/Linux-Programming-Interface-System-Ha...

      General Systems Administration:

      Essential Systems Administration: https://www.amazon.com/gp/product/0596003439/

      UNIX and Linux Systems Administration Handbook: https://www.amazon.com/UNIX-Linux-System-Administration-Hand...

      The Linux Command Line and Shell Scripting Bible: https://www.amazon.com/Linux-Command-Shell-Scripting-Bible/d...

      UNIX Shell Programming: https://www.amazon.com/Unix-Shell-Programming-Stephen-Kochan...

      BASH Hackers Wiki: https://wiki.bash-hackers.org/

      TLDP Advanced BASH Scripting Guide: https://tldp.org/LDP/abs/html/

      The Debian Administrator's Handbook: https://debian-handbook.info/browse/stable/

      TLDP Linux System Administrator's Guide: https://tldp.org/LDP/sag/html/index.html

      Performance & Benchmarking:

      Systems Performance: https://www.amazon.com/Systems-Performance-Brendan-Gregg-dp-... (this is Brendan Gregg's book where you learn about the magic of dtrace)

      BPF Performance Tools: https://www.amazon.com/Performance-Tools-Addison-Wesley-Prof... (the newer Brendan Gregg book about BPF, stellar)

      The Art of Computer Systems Performance Analysis: https://www.cse.wustl.edu/~jain/books/perfbook.htm (no longer available from Amazon, but is available direct from publisher. This is basically the one book you should read about creating and structuring benchmarks or performance tests)

      I guess that's a "reading list", but this is just a small part of what you need to know to excel in systems operations.

      I would say for the typical software developer writing web applications, the most important thing to know is how databases work and how networking works, since these are going to be the primary items affecting your application performance. But there's obviously topics not included in this list that are also worth understanding, such as browser/DOM internals, how caching and CDNs work, and web-specific optimizations that can be achievable with HTTP/2 or QUIC.

      For the average software developer writing desktop applications, I'd say make sure you /really/ understand OS internals... at the base everything you do on a computer system is based on what the OS provides to you. Even though you are abstracted (possibly many layers) away from this, being able to peel back the layers and understand what's /really/ happening is essential to writing high-quality application code that is performant and secure, as well as making you a champ at debugging issues.

      If you're trying to get into systems operations as a field, this is just a brush over the top surface and there's a lot deeper diving required.

      thread
    5. zcw100Dec 2020
      I’d recommend the Advanced Bash Scripting Guide https://tldp.org/LDP/abs/html/ and make peace with the fact that you’ll never know it all and enjoy the journey. Years later you’ll still be stumbling across new stuff.
      thread
    6. teddyhJan 2020
      Advanced Bash-Scripting Guide, working link:

      https://www.tldp.org/LDP/abs/html/

      (Your link, without “www”, gives me a certificate error.)

      thread

    Related

    Cover of Linux command line and shell scripting bible
    2011–2021

    Linux command line and shell scripting bible

    Richard Blum
    2 recommend · 4
    Cover of UNIX Shell programming
    2014–2023

    UNIX Shell programming

    Stephen G. Kochan
    4 recommend · 6
    Cover of Classic Shell Scripting
    2008–2023

    Classic Shell Scripting

    Arnold Robbins
    8 recommend · 12
    Cover of Perl Best Practices
    2008–2025

    Perl Best Practices

    Damian Conway
    22 recommend · 59
    Cover of Learning the bash Shell
    2009–2017

    Learning the bash Shell

    Cameron Newham
    2 recommend · 6
    Cover of The UNIX programming environment
    2007–2026

    The UNIX programming environment

    Brian W. Kernighan
    86 recommend · 215
    Mastering EmacsMickey Petersen
    2011–2026

    Mastering Emacs

    Mickey Petersen
    recommend · 96
    64
    Cover of Code Complete
    2007–2026

    Code Complete

    Steve McConnell
    393 recommend · 894