Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    printf 'the form\n' \
    | tr a-z A-Z
golfs to

    printf 'the form\n' |
    tr a-z A-Z
but that only saves like one or two keystrokes but is probably good to know for shell trivia questions or when implementing something that supposedly can handle shell continuation lines


djb used this style when shell scripting and I believe that is where I picked it up.^1 I have not seen (m)any HN commenters publishing their work for public scrutiny who are more skilled in programming, including C, than djb. Other programmers, good ones, but not a large number, copied his C style.

1. An extreme example

https://raw.githubusercontent.com/drudru/qhasm/master/qhasm-...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: