1. 2

    As its open source I really wish author would ‘port’ it to Linux/FreeBSD.

    SumatraPDF is so good that I use it daily on FreeBSD using WINE instead of some ‘native’ PDF viewer - I use mupdf for ‘fast’ displaying the PDF file but when I want to read a lot then sumatraPDF is the way.

    I do not like the newer versions tho - stayed at SumatraPDF 2.5.2 - works best for me.

    1. 7

      I wish they didn’t copy the Apple aesthetic though. Also, does anyone actually like “islet” keyboards?

      1. 4

        If this Framework laptop would have 7-row ThinkPad like keyboard - then I would bought it.

        Because it has typical useless island type keyboard - it make it useless for me and does not differ from all other available laptops out there.

        Guess I will stick to my 10 years old ThinkPad W520 for another decade …

        1. 1

          I love the keyboard on my X230; when I use my work supplied Macbook Pro I pine for the X230’s keys.

      1. 6

        Forced login = not read.

        1. 2

          Would be nice if this wasn’t on wordpress…

          1. 3

            I know …

            What other free blogging platform do you recommend - that also has very wide layout available?

            For example MEDIUM.COM (not that MEDIUM.COM is great - it has its own issues) is useless for me because post area is VERY narrow and that makes each code or config look unreadable because of text wrapping :(

            1. 2

              I like GitHub Pages. You can use their Jekyll install for server-side content generation or you can use a local static site generator and upload the results. This doesn’t give you a comments system or anything requiring server-side dynamic behaviour, but it is free and gives you complete control over the output.

              1. 1

                I have learned a lot from comments under my posts so not having them would be major drawback.

                1. 1

                  Fair enough. There are some third-party things that handle comments on Jekyll sites (including at least one built on GitHub comments). This narrows down the choice a bit, because if you need something writeable server side then you have all of the security implications of maintaining that and if you want to take submissions from random Internet people then you have all of the authentication / anti-spam things that come along with that. These are non-trivial costs and so you’re unlikely to find something that is both good and free.

                  1. 1

                    To be frank WordPress is quite OK for me - with uBlock Origin installed to remove the ads of course.

                    It could be less ‘heavy’ and load faster - its editor has its cravings but given the fact its free and it generally fulfills my needs I will not complain :)

                    On the contrary I really hate sites and blogs with Discuss comment system.

              2. 2

                I’ve seen a couple people using Substack, but I’m not sure if that is suitable for a personal blog.

                My blog is hosted on a tilde server, a public unix server. Admittedly, the CSS is really simple, but I like it that way. Judging from others work, using something like Jekyll to generate your site which has lead to great results even with predefined styles.

                EDIT: Also, SSG seems like a pretty nice site generator. I haven’t used Jekyll nor SSG myself.

                1. 3

                  Thank You for suggestions.

                  To be frank with you I have tried to start blogging many times … but I always focused on the layout and site instead of the content itself.

                  Here are my earlier attempts:

                  This time I wanted to focus on content and regularity and IMHO that was the key.

                  That WordPress system is a lot less important IMHO - just enable uBlock Origin in your browser and its quite usable :)

                  1. 2

                    Ah I totally get that. Configuring shit can be a pain in the ass sometimes. That’s why my CSS (view page source to see it) is only a few bytes and exists purely in the header of every page.

                    That first link was actually kinda cool though, I actually like it better than the wordpress site!

                    1. 1

                      Its not that I hated this ‘layout/design’ process … I just focused on it too much and when all was ready and setup … I did not about what I could write about :)

                      That first link was actually kinda cool though, I actually like it better than the wordpress site!

                      I also really like its simplicity. I really liked its ‘javascript preload’ for entire articles so when you select something from x. howtos then its already loaded and by clicking it you only decide to display it :)

              3. 2

                What’s wrong with WordPress?

                1. 1

                  Mostly that it’s non-free/bloated/full of cookies.

                  1. 4

                    WordPress is free software. If someone wants to use a hosted instance instead, no skin off my back - hosting things is effort.

                    1. 1

                      Ooops, I look kind of silly now. My only experience with WordPress is the sites hosted on wordpress.com, which always has annoying cookie pop-ups.

                      My bad. I still dislike it though.

              1. 11

                From A Scheme Shell, by Olin Shivers:

                Shell programming terrifies me. There is something about writing a simple shell script that is just much, much more unpleasant than writing a simple C program, or a simple CommonLisp program, or a simple Mips assembler program. Is it trying to remember what the rules are for all the different quotes? Is it having to look up the multi-phased interaction between filename expansion, shell variables, quotation, backslashes and alias expansion? Maybe it’s having to subsequently look up which of the twenty or thirty flags I need for my grep, sed, and awk invocations. Maybe it just gets on my nerves that I have to run two complete programs simply to count the number of files in a directory (ls | wc -l), which seems like several orders of magnitude more cycles than was really needed.

                I liked the example in the article, but we can also use it to show the shortcomings of Unix philosophy. Suppose we wanted to roll a 10-million-sided die (I.E., pick an integer between 1 and 10000000). Here’s what that looks like in terms of computing efficiency.

                $ time ( seq 1 10000000 | shuf | head -n1 )
                3574362
                real	0m6.966s
                user	0m6.423s
                sys	0m1.277s
                

                I ran that on my Raspberry Pi because it was a good demonstration. It’s faster on x86 systems: 2.5 seconds on a 2012-era AMD CPU, and 1.4 seconds on an Epyc Rome system from 2020.

                If we wanted to roll a 2**64-sided die, forget about it.

                In practice, what you do in Unix philosophy is write a C program called randrange or similar, adding a new verb to your language.

                Another point: one thing that makes Unix philosophy attractive is the compositionality. Compositionality is what some of us love about Forth (I’m an ex-Forther). The difficulty with both is “noise” that obscures solutions to problems. In Forth, the noise is stack juggling. In Unix, it is all the text tool invocations that massage streams of data.

                1. 21

                  On the contrary that one is ultra fast:

                  % time env LC_ALL=C tr -c -d '0-9' < /dev/random | head -c 7
                  5884526
                  env LC_ALL=C tr -c -d '0-9' < /dev/random  0.01s user 0.01s system 95% cpu 0.016 total
                  head -c 7  0.00s user 0.00s system 32% cpu 0.009 total
                  
                  1. 8

                    In gnu land:

                     time shuf -i 0-10000000 -n1
                    3039431
                    
                    real	0m0.005s
                    user	0m0.002s
                    sys	0m0.002s
                    

                    1 command, and it’s super fast.

                    -i equald the range to select from and -n equals the number of items to return.

                    1. 3

                      The shuf(1) can also be installed on FreeBSD from packages.

                      On my 10 years old system:

                      % time shuf -i 0-10000000 -n1
                      1996758
                      shuf -i 0-10000000 -n1  1.02s user 0.02s system 99% cpu 1.041 total
                      
                      % pkg which $( which shuf )
                      /usr/local/bin/shuf was installed by package shuf-3.0
                      
                      1. 2

                        Awesome! I didn’t have a BSD machine readily available, and I don’t remember the shuf details, so I didn’t want to claim it would work there. The shuf on the system I used is from GNU coreutils 8.32.

                        It seems like the BSD shuf at least in version 3.0, it actually is generating the full 10000000, since it’s taking 1s and 99% CPU.

                        The GNU version seems to skip that step, since it takes basically no time. I wonder if newer versions of BSD’s shuf also take that shortcut.

                        1. 3

                          Seems that is little more complicated :)

                          The shuf(1) I used in the above example is from sysutils/shuf package - which is:

                          “It is an ISC licensed reimplementation of the shuf(1) utility from GNU coreutils.”

                          I also have sysutils/coreutils installed and gshuf(1) from GNU coreutils [1] is a lot faster (like Your example):

                          % time gshuf -i 0-10000000 -n1
                          8474958
                          gshuf -i 0-10000000 -n1  0.00s user 0.00s system 63% cpu 0.005 total
                          

                          [1] The GNU coreutils on FreeBSD have additional ‘g’ letter in from of them to avoid conflicts - like gshuf(1)/gls(1)/gtr(1)/gsleep(1)/… etc.

                          Hope that helps :)

                          1. 1

                            My question was, if newer versions of

                            sysutils/shuf

                            also had the ability to skip creating the full range, if only 1 output was requested. At least that’s my assumption on why GNU shuf is 1s faster than the copy from sysutils/shuf

                            Otherwise I agree with everything you said, obviously.

                            1. 1

                              As I see here - https://github.com/ibara/shuf the sysutils/shuf port is at current 3.0 version.

                              There is no newer 3.1 or CURRENT version of this ISC licensed shuf(1).

                              1. 1

                                Sorry, I apologize. I assumed there was likely a new version since you mentioned:

                                On my 10 years old system:

                                way back up there somewhere.

                                Have an awesome day!

                                1. 1

                                  The 10 years old system referred to my oldschool ThinkPad W520 hardware :)

                                  The system is ‘brand new’ FreeBSD 13.0-RELEASE :)

                                  You too, thanks.

                    2. 2

                      I do find this interesting but at the same time I think it’s missing the point. I’m sure this comment was not intended to be and actually is not one of those clever “yes but what’s performance like” throwaway comments at meetings, but I wanted to pick up on it anyway.

                      One thing that the spectrum of languages has taught me is that there are different jobs and different tools for those jobs. The point that I saw from the example was composability and STDIO pipelining, with an example simple enough not to get in the way of that for newcomers.

                      You say “in practice”, directly after having just wondered about a 10-million sided die. Such an object, at least in my experience, is not something you come across in practice. As an ex D&D gamer, anything more than 20 sided is extreme for me and I suspect for most people.

                      1. 2

                        One thing that the spectrum of languages has taught me is that there are different jobs and different tools for those jobs.

                        It’s true.

                        The point that I saw from the example was composability and STDIO pipelining, with an example simple enough not to get in the way of that for newcomers.

                        Oh no, I didn’t miss the point at all. I wasn’t criticizing the example; I think it is a good one that demonstrates Unix philosophy quite well. I was making a counter-point, that with Unix philosophy, sometimes the specific solution does not generalize.

                        Another point worth making is that a solution involving pipes and text isn’t necessarily the correct one. For instance, consider the classic pipeline to count files in a directory: ls |wc -l. I use that all the time. The only reason it almost always gives correct answers is that by custom, nobody puts newlines in filenames, even though it is totally legal.

                        mkdir /tmp/emptydir
                        cd /tmp/emptydir
                        fname="$(printf "foo\nbar")"
                        touch "${fname}"
                        ls |wc -l
                        

                        That gives the answer 2. So much for counting files with wc.

                        You say “in practice”, directly after having just wondered about a 10-million sided die. Such an object, at least in my experience, is not something you come across in practice.

                        It was a whimsical use of metaphor, though maybe God plays D&D with 2**64-sided dice? The problem of picking a random integer in the range 1 to X comes up frequently enough that Python has a function in its standard library for it: random.randrange.

                      2. 2

                        If we wanted to roll a 2**64-sided die, forget about it.

                        $ time env LC_ALL=C tr -cd a-f0-9 < /dev/urandom | head -c 16
                        a7bf57051bd94786
                        env LC_ALL=C tr -cd a-f0-9 < /dev/urandom  0.00s user 0.00s system 68% cpu 0.012 total
                        head -c 16  0.00s user 0.00s system 34% cpu 0.009 total
                        
                      1. 4

                        Alternative:

                        % env LC_ALL=C tr -c -d '123456' < /dev/random | head -c 1
                        
                        1. -1

                          … and they fucked up the layout … again.

                          When companies will understand that these two are the best?

                          Good layout is far more important the being mechanics/hybrid/membrane type …

                          1. 15

                            When will people like you understand that opinions are not absolute truths? If I tell you, that, in my opinion, this is the best layout: https://massdrop-s3.imgix.net/img_comment%2FBpEZDmEkSgW4WBcowJEt_layout_1.jpg am I wrong? Or is that just yet another opinion?

                          1. 1

                            FreeBSD would be more differentiated if they could offer a GNU-less default installation.

                            1. 4

                              There is chance that FreeBSD 13.1 will be GPL-less.

                              Here is the current progress:

                              https://wiki.freebsd.org/GPLinBase

                              The remaining parts are:

                              … and from what I know that’s it.

                              All other components of FreeBSD are not licensed under GNU license.

                              1. 3

                                FreeBSD is actively working on kicking out GPL code from base.

                              1. 2

                                I use FreeBSD 13 on a 10 year laptop - ThinkPad W520 - and it works flawlessly :)

                                … and that oldschool 7-row keyboard makes all the (positive) difference - different world.

                                1. 1

                                  Could you space your posts a bit in the future @vermaden? There’s currently 6 of your stories on the frontpage

                                  1. 1

                                    I will try to, sorry, did not meant to ‘steal’ the front page.

                                    For the ‘excuse’ - none of these stories are ‘mine’ or from ‘mine’ blog :)

                                  1. 3

                                    +1 for herbe! It’s a neat, minimalist tool. However, I’ve taken to using phillbush/xnotify instead. Configuration via .Xresources, supports rendering icons, etc. The author also has a bunch of other neat X tools.

                                    1. 1

                                      The herbe also supports configuration using ~/.Xresources file - there is patch for that in the GitHub repository :)

                                    1. 2

                                      … also as FreeBSD recently got ARM64 into TIER 1 architecture - which means binary updates with freebsd-update(8) along with security patches and binary packages using pkg(8) then suddenly Raspberry Pi 4 8GB become very interesting and wanted SBC :)

                                      1. 2

                                        ODROID-H2+ which is small 4 cores x86 system: https://www.hardkernel.com/shop/odroid-h2plus/

                                        1. 3

                                          If someone wants to switch from classic 7-row ThinkPad with proper INS/DEL HOME/END PGUP/PGDN keys combo to Mac keyboard and treats that as an upgrade then I do not want to read the rest of the article. Loss of time.

                                          1. 2

                                            I am currently compatible with two kinds of keyboards.

                                            • ThinkPad 7-row laptop ANSI keyboard (like in T420)

                                            • 87 keys ANSI keyboard (does not have to be mechanical) [1]

                                            All other keyboard layouts literally does not exist for me - not matter how ‘hackable’ or ‘open source’ or configurable they are …

                                            [1] https://mechanicalkeyboards.com/shop/images/products/large_914_es87_front1000.png

                                            1. 5

                                              I can not use FISH shell as it does not support such basic POSIX for loops as these:

                                              % for LOG in ls *.log; do tail -5 ${LOG}; done
                                              

                                              Its pointless to learn another new FISH syntax just for this …

                                              If it would support the I could try it and maybe switch from ZSH … but once you setup your ZSH shell there is no point in using any other shell then ZSH …

                                              1. 10

                                                The syntax change is minimal:

                                                > for LOG in ls *.log; tail -5 $LOG; end
                                                

                                                Like mentioned in the sibling comment, any ad-hoc pipeline that gets involved should probably be a POSIX script for portability and reusability.

                                                The time commitment and fragility of a comparable ZSH setup is why I switched to Fish. Compare my .zshrc at 239 lines and my config.fish at 52 lines.

                                                1. 9

                                                  But what’s the advantage of the different syntax? Most people considering Fish will already be familiar with POSIX for loops. and will still be writing POSIX for loops for both shell scripts and for interactive shells on other systems. Is the extra “do” so annoying that it’s worth the extra overhead of constantly switching between the different shell for loop syntaxes?

                                                  This is literally the main reason why I’m not using fish. I appreciate the good out-of-the-box configuration. I’m painfully familiar with ZSH’s fragility; it even made me switch back to bash. I would love a good, modern, pretty, nice-out-of-the-box shell. I just don’t want to use a non-POSIX shell. When I’m just writing pipelines and for loops interactively, POSIX shell’s issues aren’t really relevant When I’m writing anything complex enough for POSIX shell’s issues to be relevant, it’s in a shell script in a file, and I don’t want all my shell scripts to use some weird non-standard syntax which will preclude me from switching to a different shell in the future. So fish’s “improved” syntax is a disadvantage for interactive use, and isn’t something I would use for non-interactive use anyways.

                                                  Also, the official documentation tells you to run chsh -s <path to fish> to switch to Fish. Well, large parts of UNIX systems expect $SHELL to be POSIX-compatible. If you follow the official documentation your Sway configuration will break, all Makefiles will break, your sxhkd config will break, and lots of other programs will break. If it’s going to recommend switching to Fish with chsh, it really should be POSIX compatible.

                                                  IMO, fish is an amazing shell made less relevant through insistence on having a syntax which doesn’t even remotely resemble POSIX shell syntax.

                                                  1. 11

                                                    Also, the official documentation tells you to run chsh -s to switch to Fish. Well, large parts of UNIX systems expect $SHELL to be POSIX-compatible. If you follow the official documentation your Sway configuration will break, all Makefiles will break, your sxhkd config will break, and lots of other programs will break. If it’s going to recommend switching to Fish with chsh, it really should be POSIX compatible.

                                                    This is simply not true. I use fish as my default shell and never had a problem with makefiles or my window manager, I use i3, but don’t know why sway would be different. I never encountered software that just runs scripts like that, they either have a #! line that specifies the shell or just call bash -c/sh -c directly or whatever.

                                                    IMO lack of Posix compliance in fish is a non issue, specially for experienced users which will know how to fallback to bash or write scripts and use #!. I used zsh for a long time and I’d use bash for scripts I could share with my team and everything just works. I feel like I could have switched to fish a lot sooner if I just tried instead of being put off by comments like these. If you are curious, just try it, maybe it’s for you, maybe it’s not, but don’t rely on other people’s opinion.

                                                    For me the biggest advantage of fish is I can easily understand my config. With zsh I had a bunch of plugins and configs to customize it and I understand almost none of it. Every time I wanted to change it I would lose a lot of time. Documentation was also a pain, searching for obscure features you had to read random forums and advice and try different things. fish has a great manual, and great man pages, everything is just easy to learn and lookup. I value that more than I value POSIX compliance, maybe you don’t, but form your own opinion.

                                                    1. 3

                                                      This is simply not true. I use fish as my default shell and never had a problem with makefiles or my window manager

                                                      I’m happy that you haven’t experienced issues. I know 100% for a fact that having a non-POSIX $SHELL was causing a lot of issues for me last time I tried using fish. Maybe you’ve been lucky, or maybe they have a workaround now.

                                                      For me the biggest advantage of fish is I can easily understand my config. With zsh I had a bunch of plugins and configs to customize it and I understand almost none of it.

                                                      That’s fine. I agree that the things you mention are advantages of fish. I was wondering what the advantage of a different syntax is. Like, in which ways would fish but with a POSIX syntax be worse than the current implementation of fish? In which situations is it an advantage to have a POSIX-incompatible syntax?

                                                      1. 3

                                                        There is the right and the wrong way to switch to fish: The right way is to set the login shell for a user (i.e. replace /bin/bash with /usr/bin/fish in /etc/passwd, either manually or with chsh).

                                                        The wrong way is to point /bin/sh at /usr/bin/fish: That, and only that symlink, is what matters to everything that implicitly invokes “the shell” (i.e. /bin/sh) without a hashbang, such as Makefiles. I’m not surprised at the carnage you described if you did this.

                                                        1. 3

                                                          I, too, used fish for a while and did observe breakage, and I for sure did not do anything as silly as that. I remember in particular this bug: https://github.com/fish-shell/fish-shell/issues/2292 After that I changed my shell to bash and did exec fish in .bashrc. This, IIRC, did fix most of the bugs, though I still had to be careful: some scripts don’t actually use a shebang and expect the shell to notice that the executable is a shell script.

                                                          For example:

                                                          $ echo echo 5 > x.sh
                                                          $ chmod +x x.sh
                                                          

                                                          Then, from bash:

                                                          $ ./x.sh
                                                          5
                                                          

                                                          And from fish:

                                                          Failed to execute process './x.sh'. Reason:
                                                          exec: Exec format error
                                                          The file './x.sh' is marked as an executable but could not be run by the operating system.
                                                          
                                                        2. 2

                                                          That’s fine. I agree that the things you mention are advantages of fish. I was wondering what the advantage of a different syntax is. Like, in which ways would fish but with a POSIX syntax be worse than the current implementation of fish? In which situations is it an advantage to have a POSIX-incompatible syntax?

                                                          That I don’t know. It’s possible that fish would be better if it was POSIX compatible, I was just saying that even though it is not POSIX compatible, it’s still worth using. I think fish syntax is better for interactive use than bash/zsh, but that is just my opinion. For script use I use bash anyway. One exception is when writing custom completions for my custom commands and then I am oh so grateful I am not using bash/zsh and not using that syntax.

                                                      2. 1

                                                        Could not agree more.

                                                        If one day FISH shell will also accept POSIX syntax for the while and for loops then I can look into it.

                                                      3. 3

                                                        I have tons of scripts but I also use these for and while POSIX loops all the time … and putting them in scripts is pointless because everytime its for different purpose or for different files or commands.

                                                        Besides I have made a syntax error and I can not edit my comment now :)

                                                        If should be either like that:

                                                        % for LOG in *.log; do tail -5 ${LOG}; done
                                                        

                                                        … or like that:

                                                        % for LOG in $( ls *.log ); do tail -5 ${LOG}; done
                                                        

                                                        I really do use these POSIX for and while loops interactively all the time, not sure that this serves as a proof but:

                                                        % grep -c -e 'for ' ~/.zhistory
                                                        522
                                                        
                                                        % grep -c -e 'while ' ~/.zhistory
                                                        653
                                                        

                                                        Thanks for sharing the ZSH config. Mines is at about 230 lines which 1/4 is for all shells variables like PATH or less(1) settings and 3/4 for ZSH itself.

                                                      4. 10

                                                        Note that fish is focused on being an interactive shell, so, if you primary metric is how easy it is to write a for loop, you are looking at the tool of a wrong class.

                                                        I personally use fish to type single-line commands in with out-of-the-box autosuggestions. If a need a for loop, I launch Julia.

                                                        EDIT: sorry, I’ve misread your comment. The general point stand, but for a different reason: POSIX compat is a non-goal of fish.

                                                        1. 1

                                                          How would you do what vermaden did up there with Julia? Seems to me like a huge overkill, but then again if you’re sufficiently proficient with Julia, it might make sense.

                                                          1. 3
                                                            for log in filter(it->endswith(it, ".log"), readdir())
                                                                   run(`tail -5 $log`)
                                                            end
                                                            

                                                            The absence of globbing out of the box is indeed a pain.

                                                            On the other hand, I don’t need to worry about handling spaces in param substitution.

                                                            EDIT: to clarify, I din’t claim that Julia is better than zsh for scripting, it’s just the tool that I use personally. Although for me Julia indeed replaced both shell and Python scripts.

                                                            1. 1

                                                              This would also work in Julia, is pretty short and shows how you can use patterns to find files (there’s Glob.jl, too, but I miss the ** glob from zsh):

                                                              [run(`tail -5 $log`) for log in readdir() if contains(log, r".log$")]
                                                              

                                                              You might not know that endswith, contains and many other predicates in Julia have curried forms, so you could have written:

                                                              for log in filter(endswith(".log"), readdir())
                                                                  run(`tail -5 $log`)
                                                              end
                                                              
                                                              1. 1

                                                                Thanks, I didn’t know about that!

                                                                Don’t you need \. in regex though?

                                                                1. 1

                                                                  You’re welcome! And haha, yes, I should have escaped the dot :)

                                                              2. 1

                                                                IMHO that is a lot of pointless typing instead of just respecting the standards - like POSIX one.

                                                                1. 4

                                                                  I agree that’s more typing! But pointlessness is in the fingers of typer, so to say.

                                                                  I personally don’t know bash — it’s too quirky for me to learn it naturally. Moreover, for me there’s little value in POSIX: I am developing desktop software, so I care about windows as well. For this reason, I try not to invest into nix-only tech.

                                                                  On the other hand, with Julia I get a well-designed programming language, which lets me to get the stuff done without knowing huge amount of trivia a la set -e or behavior of ${VAR} with spaces.

                                                                  There’s also an irrational personal disagreement with stuff that’s quirky/poorly designed. If I were in a situation where I really needed a low-keystroke shell scripting language, I am afraid I’d go for picking some un-POSIX lisp, or writing my own lang.

                                                                  1. 3

                                                                    To be honest, I find the snippet vermaden posted to already have lots of unessessairy typing. There’s no reason to use a loop if all you want is map commands to line. Xargs exists for this exact reason.

                                                                    But more to the point, what’s stopping you from calling Bourne shell whenever you need? Fish clearly states in its manual that it is not intended to be yet another scripting language, which in my opinion is an important and useful divide. I still write shellscripts all the time and have been a fish user for 10 years.

                                                                    1. 1

                                                                      what’s stopping you from calling Bourne shell whenever you need?

                                                                      Now you are maintaining TWO configurations for interactive shells.

                                                                      My shell is where I command my computer. If I need, or am encouraged, to leave my shell to command my computer, my shell has failed.

                                                                2. 2

                                                                  Can’t speak for julia, but here it is in raku:

                                                                  dir.grep(/'.'log$/).map: *.lines.tail(5)
                                                                  

                                                                  Which is almost as concise as shell, and maintains more structure in its output.

                                                                3. 1

                                                                  I write loops interactively in shell all the time. I wouldn’t consider a language suitable for interactive use as a shell if it lacked loops (or some other iteration mechanism).

                                                                4. 9

                                                                  Is this flame bait? If you get over the syntax hurdle, there are many reasons why for loops with globs, especially interactively, are better written in fish:

                                                                  1. Try typing this in your terminal, with newlines:

                                                                    for LOG in *.log
                                                                        tail -5 $LOG
                                                                    end
                                                                    

                                                                    See? Who needs one-liners when you can have multiple in fish? This way, it stays easy to edit, read and navigate (2-dimensionally with the arrow keys) as you pile onto it.

                                                                  2. In case your *.log expansion doesn’t match any file – compare this with any POSIX shell!

                                                                    As a command argument…

                                                                    ls *.log
                                                                    

                                                                    …and in a for loop:

                                                                    for LOG in *.log
                                                                        echo found $LOG
                                                                    end
                                                                    

                                                                    As a command argument, fish prints an error, and doesn’t even run the command if the glob failed. In a for loop, the loop just iterates 0 times, with no error printed. In POSIX shelll, you can get either of these behaviours (by setting failglob or nullglob), but not both, which is a dilemma.

                                                                  3. Recursive globs are on by default (not hidden behind the globstar flag) – who needs find anymore?

                                                                    for LOG in **.log
                                                                        echo found $LOG
                                                                    end
                                                                    
                                                                  1. 4

                                                                    Its not a troll attempt.

                                                                    Its not my intention to force anyone to use ZSH or to discourage anyone from using FISH … besides I have made a syntax error and I can not edit my comment now :)

                                                                    If should be either like that:

                                                                    % for LOG in *.log; do tail -5 ${LOG}; done
                                                                    

                                                                    … or like that:

                                                                    % for LOG in $( ls *.log ); do tail -5 ${LOG}; done
                                                                    

                                                                    I really do use these POSIX for and while loops interactively all the time, not sure that this serves as a proof but:

                                                                    % grep -c -e 'for ' ~/.zhistory
                                                                    522
                                                                    
                                                                    % grep -c -e 'while ' ~/.zhistory
                                                                    653
                                                                    
                                                                    1. 3

                                                                      one-liners

                                                                      I don’t see how this is different from standard shell:

                                                                      for LOG in *.log; do
                                                                              tail -5 $LOG
                                                                      done
                                                                      

                                                                      This is how I usually write loops in scripts.

                                                                      1. 2

                                                                        It isn’t different. The command line behaviour is.

                                                                        Can you type such a multi-liner ↑ at the command line, edit it all at once (not just one line at a time, with no turning back, as in Bash), and retrieve it from history in its full glory?

                                                                    2. 5

                                                                      I used zsh for a long time before switching to fish, and I basically found the interactive mode for fish to be a lot nicer—akin to zsh with oh-my-zsh, but even nicer, and faster. I absolutely switched for the interactive experience; most of my scripts are still written in bash for portability to my teammates.

                                                                      The scripting changes make for a language that is a lot more internally consistent, so I have found that for my ad-hoc loops and stuff I do less googling to get it to work than I do using bash and zsh. Learning another shell syntax as idiosyncratic as bash would be very frustrating. At least with fish, it’s a very straightforward language.

                                                                      If you are thinking about trying another shell, oil might be your jam, since it aims to be similar to POSIX syntax, but without as much ambiguity.

                                                                    1. 7

                                                                      The Mac OS X Snow Leopard was probably the best looking and polished Mac GUI.

                                                                      The only thing that comes close was Solaris 10 at its peak: https://i.imgur.com/vyDd6lG.png

                                                                      1. 5

                                                                        Some other helpful links for FreeBSD Boot Environments that I’ve found over time.

                                                                        1. 7

                                                                          I wish the normal upgrade process automatically created a new BE for the pre-upgrade state. Nexenta’s version of apt did this and had an apt rollback command. If that works reliably then you can always upgrade to the new shiny whatever, secure in the knowledge that you can revert if it broke things. You can do the same with FreeBSD, but it’s a lot more manual steps.

                                                                          1. 4

                                                                            Yes it would be great if at least freebsd-update(8) had a -B flag (example) to do the upgrade within new BE.

                                                                            At least the additional steps are very few and not that hard.

                                                                            1. 3

                                                                              I would be willing to do this, if no one else plans on doing it. Any devs here to comment?

                                                                              1. 2

                                                                                Adding support for that to freebsd-update(8) may be an interesting project. It might be a better idea to add this functionality as a separate program instead, because it could be that freebsd-update will be gone in FreeBSD 14 or FreeBSD 15 because of pkg base.

                                                                            2. 2

                                                                              For those building from source, there is beinstall(8) available, which automates installation and boot environment management.

                                                                              1. 2

                                                                                Pity beinstall(8) is only for compiling the sources.

                                                                                Its not an issue on a 16-core AMD Ryzen but its PITA on a 2-core low power laptop CPU :)

                                                                          1. 2

                                                                            If it would use one of these:

                                                                            • ThinkPad like 7-row ANSI layout
                                                                            • 87 keys ANSI keyboard [1]

                                                                            Then I might be interested in it.

                                                                            With current layout? It literally does not exist to me :)

                                                                            [1] https://mechanicalkeyboards.com/shop/images/products/large_914_es87_front1000.png

                                                                            1. 2

                                                                              I went for the Tex Shinobi. It has the ThinkPad 7-row layout. I love it. https://tex.com.tw/products/shinobi?variant=16969883648090

                                                                              1. 2

                                                                                I love the idea - it looks really nice - but the price kills all my enthusiasm here :)

                                                                                I use ThinkPad W520 daily so that one will suit be best probably.

                                                                                I also have the ‘mythical’ ThinkPad SK-8855 and I am still amazed that I was able to get it in Poland for only $50 … its in good condition so I treat it kinda like artifact :)

                                                                                I recently also got my first both wireless and wired mechanical keyboard for $45 - the Motospeed-GK82 - reviews are good - life will show how it behaves when it arrives …

                                                                                Motospeed GK82:

                                                                                https://ae01.alicdn.com/kf/H490271643794493e938c8c3322d3ec80M.jpg_q50.jpg

                                                                                1. 1

                                                                                  Yes, the Tex was a bit of a treat to myself last year. I use it daily and love it so much. I can’t ever see myself becoming a mechanical keyboard nut, because I don’t want anything other than this thing on my primary machine :D.

                                                                                  Hah! I have about 5 of those external ThinkPad keyboards. I didn’t know they were “mythical”! :D. I have them attached to Raspberry Pis and home servers, because it gives me a keyboard and mouse on one USB port. :) Maybe I should take more care of them.

                                                                                  1. 1

                                                                                    Currently there is only ONE for $150 on entire EBAY …

                                                                                    https://www.ebay.com/sch/33963/i.html?_nkw=sk+8855

                                                                                    Today they are rare … and valuable.

                                                                                    1. 1

                                                                                      That’s my retirement fund sorted then! :D

                                                                                      1. 2

                                                                                        You can add several VT220 to that lot for asset diversification :)

                                                                            1. 7

                                                                              About that arm64/aarch64 TIER 1 case …

                                                                              This will kinda help you:

                                                                              https://up.bsd.lv/

                                                                              Description from the page itself:

                                                                              up.bsd.lv is a proof-of-concept of binary updates using freebsd-update(8) for FreeBSD 13.0-CURRENT and 12-STABLE to facilitate the exhaustive testing of FreeBSD and the bhyve hypervisor and OpenZFS 2.0, and to help elevate ARM64 to Tier 1 status. Updates are based on the SVN revisions of official FreeBSD Release Engineering weekly snapshots.

                                                                              Features:

                                                                              • Kernels are built with the GENERIC-NODEBUG configuration file

                                                                              • /etc/freebsd-update.conf is modified to use up.bsd.lv

                                                                              • /usr/sbin/freebsd-update is modified to “xargs” parallel phttpget (Thank you Allan Jude)

                                                                              • freebsd-update(8) does not output to the $PAGER

                                                                              Hope that helps.

                                                                              reply

                                                                              1. 1

                                                                                Thank you! m(_ _)m

                                                                                1. 1

                                                                                  This looks really useful. Thanks!