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
    Cover of Beginning portable shell scripting

    Beginning portable shell scripting

    Peter Seebach · 2008

    Systems & OSProgramming
    Open LibraryAmazon
    Stats for nerds
    2recommend
    3mentions
    3people
    2017–2018years
    67% recommend33% neutral

    Mentions per year

    20172018

    What Hacker News says

    1. eltoozeroJan 2018
      Sometimes - perhaps often - you are in situations where you have no control over the shell, in these cases writing "portable" shell scripts is helpful.

      I have been enjoying "Beginning Portable Shell Scripting"[0] by Peter Seebach for this very reason.

      [0]https://www.apress.com/us/book/9781430210436

      thread
    2. Alexqw85Jan 2018
      I would like to second this recommendation. I have found "Beginning Portable Shell Scripting" to be invaluable --- and far more comprehensive than I expected given the "Beginning" in the title.

      I highly recommend it (and the POSIX docs) to anyone who is is interested in portable shell programming.

      ---Alex

      thread
    3. chubotAug 2017
      That's not useful advice. That's what I mean by "memorizing the manual" (or POSIX spec).

      There's no way to test that the commands you're running will actually work on someone else's machine, other than by "memorizing the manual".

      I have an entire book on this:

      https://www.amazon.com/Beginning-Portable-Shell-Scripting-Pr...

      It goes through all the commands and common versions of Unix and which flags are likely to work, etc.

      Even that book admits there's a lot of folklore, because nobody has actually gone and tested things recently. Something as simple as safely writing with "echo" is a problem. You can argue that any script that uses echo $foo is incorrect (because $foo might be a flag). Conversely 'echo --' is supposed to print -- by POSIX.

      The only people who are likely to even attempt this are people whose full-time job it is to write shell scripts, or the authors of tools like autoconf, which must generate portable shell. autoconf shell is a good example of the anachronisms and hoops you need to jump through to support this style.

      Nobody else has time for that, because they have to spend their mental energy writing C and C++, not shell and make. So that's why we have pretty low standards for the quality of build systems. The tools aren't there to support writing a robust and easy-to-use build system.

      thread

    Related

    Cover of Classic Shell Scripting
    2008–2023

    Classic Shell Scripting

    Arnold Robbins
    8 recommend · 12
    Cover of UNIX Shell programming
    2014–2023

    UNIX Shell programming

    Stephen G. Kochan
    4 recommend · 6
    Cover of The UNIX programming environment
    2007–2026

    The UNIX programming environment

    Brian W. Kernighan
    86 recommend · 215
    Cover of Advanced programming in the Unix environment
    2008–2025

    Advanced programming in the Unix environment

    W. Richard Stevens
    100 recommend · 153
    Cover of Learning the bash Shell
    2009–2017

    Learning the bash Shell

    Cameron Newham
    2 recommend · 6
    Cover of Code Complete
    2007–2026

    Code Complete

    Steve McConnell
    393 recommend · 894
    Advanced Bash-Scripting GuideMendel Cooper
    2011–2026

    Advanced Bash-Scripting Guide

    Mendel Cooper
    16 recommend · 33
    Cover of A Practical Guide to Linux Commands, Editors, and Shell Programming
    2017–2020

    A Practical Guide to Linux Commands, Editors, and Shell Programming

    Mark G. Sobell
    2 recommend · 3