1. 1

    When was this website first published or this idea introduced?

    2012-01-01.

    Sure it made its way into the world. It’s true that I live under a rock, but it is now 2017 and I never heard of this…

    1. 2

      For a moment I thought someone wrote a free-software library wrapping the ugly standard C library with sensible and safe calls.

      Now I’m going to think all weekend of it

      1. 1

        Did someone inform James Rolfe?

        1. 4

          yes is not useless. It is used to automatize confirmation of programs which heavily rely on user interaction. Like in yes | apt-get install something. Now, apt should have an option for that, but this is what the program is meant for.

          The “funny” argument is just subjective :D

          …like in sl: you are very concentrated on your work, then you mistype sl and get annoying thing happening. That’s also why I get annoyed by the default apt-suggestion in ubuntu: you type sl instead of ls and have to wait until you get notified about “we have sl, just install it”.

          1. 1

            Now, apt should have an option for that

            Should, and does have. From apt-get(8):

               -y, --yes, --assume-yes
                   Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively.
                   If an undesirable situation, such as changing a held package, trying to install a unauthenticated
                   package or removing an essential package occurs then apt-get will abort.
                   Configuration Item: APT::Get::Assume-Yes.
            

            And in defense of the article, it’s funny OR useless.

          1. 1

            In general, vim’s point of strength is being hacker-friendly in the interface: even if commands are not always consistent, they are very practical, and aim to become like an extension of your body.

            Even if I would not have lots of fancy plugins, I would still use vim just because of things like . (repeat command) or the command-movement combo.

            Sure thing, getting rid of deprecated stuff is a good idea, and maintainability is important, but what we don’t need is another eclipse…

            1. 2

              Don’t worry, Neovim doesn’t plan to change any of the basic features of Vim, or any of the built-in commands. From the README:

              It is important to emphasize that this is not a project to rewrite vim from scratch or transform it into an IDE (though the new features provided will enable IDE-like distributions of the editor). The changes implemented here should have little impact on vim’s editing model or vimscript in general. Most vimscript plugins should continue to work normally.

              This project only directly affects plugin developers and Vim developers, not end-users. But Neovim will make it more likely that people will build cooler plugins, so it will affect end-users indirectly. And some end-users might turn into plugin developers because developing plugins will be easier in Neovim.

            1. 5

              Good ol' RMS… Freedom is only freedom if you prevent people from using it non-freely.

              1. 1

                Freedom as such is a difficult concept. Paradoxically restrictions are needed to maintain freedom, exactly for the same reason we need fair rules and just governments.

              1. 3

                When I’m in doubt about shell expansion, I usually run echo-eol which is like this:

                #!/usr/bin/perl -w
                #
                # Just to verify how command line arguments work in weird cases.
                
                use strict;
                use warnings;
                
                my $i = 0;
                foreach my $arg (@ARGV) {
                    printf "%03d> '%s'\n", $i++, $arg;
                }
                

                Also, since at work I’ve got a secondary monitor, I use the workscreen commands, which is a shorthand for xrandr:

                #!/bin/sh
                
                export LAPTOP="LVDS-1"
                export SCREEN="DP-1"
                
                case $1 in
                
                    "dual")
                        xrandr --output $SCREEN --auto
                        xrandr --output $LAPTOP --auto
                        xrandr --output $SCREEN --above $LAPTOP
                    ;;
                
                    "laptop")
                        xrandr --output $LAPTOP --auto
                        xrandr --output $SCREEN --off
                    ;;
                
                    "screen")
                        xrandr --output $SCREEN --auto
                        xrandr --output $LAPTOP --off
                    ;;
                
                    *)
                        echo "laptop | screen | dual"
                    ;;
                
                esac
                

                As Vim user, I don’t like caps lock and I prefer esc instead…

                #!/bin/sh
                
                case $1 in
                  "enable")
                    xmodmap -e 'clear lock'
                    xmodmap -e 'keycode 0x42 = Escape'
                    ;;
                  "disable")
                    xmodmap -e 'keycode 0x42 = Caps_Lock'
                    xmodmap -e 'add lock = Caps_Lock'
                    ;;
                  *)
                    echo "usage: $0 enable|disable"
                esac
                

                …those are the most interesting home-made commands of mine. I’ve got some other commands which are more complex, but they’re very specific for my routine.

                1. 1

                  Question: I don’t understand the point of doing cat < instead of just cat: did the author mean tail -f maybe?

                  1. 1

                    In essence, yes. cat < file apparently keeps reading, though in testing that’s not always true. That may be a bash or linux (or /proc) specific detail.

                  1. 1

                    This is a very useful post: I never looked at this things in detail, even if I’m using the shell for basically anything. The fact is that if I need something more complex than a certain threshold I switch to Python.

                    1. 1

                      Interesting. In principle you should be also able to build an arbitrary number of indexes of the same array. Say for instance that the array is populated with tuple, you could build a sorting for each field. Like the option -k of sort. Just pass a “key” parameter (callback) and you are done :)