Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Tuesday December 01 2015, @07:50PM   Printer-friendly
from the features-are-beneficial-bugs dept.

We make very careful considerations about the interface and operation of the GNU coreutils, but unfortunately due to backwards compatibility reasons, some behaviours or defaults of these utilities can be confusing.

This information will continue to be updated and overlaps somewhat with the coreutils FAQ, with this list focusing on less frequent potential issues.

Good tips and reminders for those who don't work mostly with a CLI (Command Line Interface).


[What has been YOUR biggest CLI gotcha? -Ed.]

Original Submission

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Interesting) by VLM on Tuesday December 01 2015, @10:49PM

    by VLM (445) on Tuesday December 01 2015, @10:49PM (#270385)

    So thirty years ago the biggest problem was dropping your punch card deck when you'd submit a job; just kidding. So its hard to remember.

    Fun things that still occasionally happen:

    Errors in judgement with xargs in general and especially the -n option. Tends to be a performance kill not a major disaster, but its still annoying as hell. Shouldda used find and xargs there, how the heck was I to predict we'd have five hundred thousand files one day in that directory. I always kinda thought there would never be more than one LOL.

    Ditto log deletion and rotation. So I turned on query logging to debug something, forgot about it for six months, come to work with a nastygram from the fileserver admins asking WTF I'm killing the whole file server by appending to the end of a nearly terabyte length log file. Deleting that helped with my quota quite a bit. Actually I think it resulted in them putting a quota on me.

    Its still possible to make mistakes with tab expansion and concatenation vs redirection. vi wtf.appendtoend cat wtf.appendtoend "looks fine to me" cat wtf.appendtoend > wtf "Son of a ... I can't believe I did it again... OK... sigh .. wheres the backups..." vi /etc/passwd.demonstration to show off how badass I am, rm /etc/passwd tab tab tab hit enter, F I just nuked /etc/passwd not /etc/passwd.demonstration. Or similar. In general I get more done by slowing down and not being in a hurry. Some of my best disasters have come from being in a hurry.

    Starting Score:    1  point
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 2) by darkfeline on Wednesday December 02 2015, @03:05AM

    by darkfeline (1030) on Wednesday December 02 2015, @03:05AM (#270464) Homepage

    I use GNU Parallel now instead of xargs, much better in my opinion, especially not having the fudge about with whitespace handling.

    --
    Join the SDF Public Access UNIX System today!
    • (Score: 2) by Marand on Wednesday December 02 2015, @08:04AM

      by Marand (1081) on Wednesday December 02 2015, @08:04AM (#270529) Journal

      Parallel is a gotcha in and of itself, because there are two separate versions of it that have different behaviours and arguments, at least in Debian. One is part of the "moreutils" package, while the GNU one (which is awesome) is its own standalone package named parallel. You can't have both installed because they both want /usr/bin/parallel, so if you need anything else that's in moreutils, you're stuck with the shittier version of parallel.

      The right solution would be to have parallel.gnu and parallel.moreutils and use Debian's alternatives system to make a symlink, or split parallel out of moreutils and let the user choose which one to keep, but it's been an issue since 2010 and as far as I know is still an ongoing source of bullshit, finger-pointing, and ego clashes even now. (It may have been corrected now, but when I last checked earlier this year it was still a problem...)

      • (Score: 1, Funny) by Anonymous Coward on Wednesday December 02 2015, @01:28PM

        by Anonymous Coward on Wednesday December 02 2015, @01:28PM (#270622)
        Perhaps in a parallel universe it's possible to use parallel in parallel with parallel. ;)
      • (Score: 2) by VLM on Wednesday December 02 2015, @01:44PM

        by VLM (445) on Wednesday December 02 2015, @01:44PM (#270633)

        I don't even use Debian anymore, mostly freebsd, but I found this

        https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=749355 [debian.org]

        Usually these kind of things are resolved a little quicker.

        • (Score: 2) by Marand on Wednesday December 02 2015, @07:52PM

          by Marand (1081) on Wednesday December 02 2015, @07:52PM (#270872) Journal

          Yup, I was following that for a while and it had no sign of improvement up to about March of this year. It looks like progress i'd belong made finally but they're still stuck on the same problems because the gnu one deprecated the compat switch that makes it work like the other, the other doesn't care anout the gnu one, and nobody can agree on how to deal with that.

          One reason this has dragged on for so long is the old maintainer, Joey Hess, got pissy over someone bringing in the technical committee after he failed to do anything with the problem for a while. He complained about it being a time problem not a technical one, objected to their involvement, and abandoned the package in a huff of 'screw you i'm taking my ball home'

      • (Score: 2) by darkfeline on Thursday December 03 2015, @01:32AM

        by darkfeline (1030) on Thursday December 03 2015, @01:32AM (#271084) Homepage

        That sounds like a problem with Debian and perhaps moreutils, which, in addition to having a bad maintainer, isn't very useful last I checked. Especially sponge, which can be easily done with regular shell IO redirection.

        --
        Join the SDF Public Access UNIX System today!
        • (Score: 2) by Marand on Thursday December 03 2015, @06:43AM

          by Marand (1081) on Thursday December 03 2015, @06:43AM (#271229) Journal

          Oh, it is, definitely. It's a huge potential gotcha though, I had moreutils installed for vipe (insert text editor into a pipe chain) and went to use parallel one day and the much-inferior moreutils parallel caused me no end of trouble. I figured out the problem, went to install the gnu one, and that opened a whole new can of worms with the conflicts. I decided parallel was more useful than all of moreutils, though, so I just tossed moreutils to the bin over the whole nonsense.

          Still, It's nothing but pain if you don't realise, especially if you learn about parallel from a website or person that doesn't mention there's an inferior version floating around...