Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)Q
Posts
11
Comments
398
Joined
12 mo. ago

  • I'm not talking about the color variant (which doesn't look like a toirtoise at all, really). OP's cat's belly looks like a literal tortoise shell.

  • Who cares!? Commenting on Lemmy is about expressing IMPOTENT NERD RAGE! It has nothing to do with truth or facts. I simply want to be ANGRY and yell in all caps about SOMETHING at least twice a day! And I will do so without even reading the article!

    SO SHUT UP AND LET ME RAGE!!!

    -- Original commenter, probably

  • OP didn't say "tortie". They said tortoise shell pattern. (Well, they implied that.) The pattern of dots on the cat's belly does indeed look kind of like a tortoise shell.

  • The image's content is plain wrong. Waxing poetic about JPEG artifacts doesn't make this image any more interesting or funny. It's just dumb.

  • Prongles

  • And it blew the fucking AC unit out of the window, but their ears are fine!

  • GNOME is Not an Overly Mediocre Experience.

  • What does GNOME stand for? Wrong answers only.

  • I just want ~slaves~ employees to be more motivated. Give them the drug!

  • Removed

    Tiny ramen shop

    Jump
  • God, I wish Cup noodles tasted as good as real ramen.

  • Literally none. It has never caused confusion or accidental pastes of private information into web browsers.

  • It's "barn", not "burn"

  • What do you all think about zram?

  • Wait, is "dark pattern" taboo now?

  • Yeah, I use that, too. It might differ from DE to DE, but in KDE, there's the normal clipboard, and then there's the one for selections and middle-click. They don't share the same contents by default, but you can enable that.

  • I can't tell you how many times I've accidentally pasted random private stuff from that goddamn middle click into WEB PAGES! Things that can read whatever text you type without having to explicitly submit anything. It's a horrible thing for a new user to discover by accident. It's such an unexpected feature to new users, and no one gets told about it, ever. You simply discover it by accident.

    This is a good change, not having it on by default.

    To all the haters of this idea, god forbid we make Linux less weird by default for people migrating from Windows.

    All that said, I have learned to love select-to-copy and middle-click paste. Especially in the terminal.

  • Aww! What's her name?

  • for loops

    Your code executes ls and records the results in a variable. The result is some text, a string of characters. (We call them "strings" and i is now a string variable.) Among the characters in a string variable might be spaces, tabs, or new line characters. I mention this because the special variable IFS is used by for loops, and it contains exactly one space, tab, and new line by default.

    When you call for with a string as the input, it splits the string into units by splitting on each character in IFS. That is, it splits the big string into individual parts by splitting at each space, tab and new line. So this creates an array which is what is looped over. Each word in turn is assigned to your looping variable and then the code after the do is executed once per word.

    ("word" has a sort of a special meaning here. When I say word, I mostly just mean a string that has no spaces in it. When you read text in English, there are words. They're strings of characters separated by spaces. But words can also be separated by tabs, commas, semicolons, or whatever, but not by default when using for! You have to modify IFS to add those characters if you want them to be considered word separators.)

    So, if any of the file system entries returned by ls have spaces in them, your loop is going to create more outputs than there are file system entries in the current directory.

    For example:

     
        
    file one.txt
    file two.txt
    my photo.jpg
    notes (final).md
    a b c d.txt
    
      

    That would cause like 12 loops and 12 outputs in your code despite there only being five files.

    If you instead overwrite IFS before running your loop, and only assign a single new line to the variable, then your loop will only be over the actual lines of the input text. Like this:

    IFS=$'\n'

    and then use your exact code above. Using my example of five files, this code will now only produce 5 outputs, not 12.

    You can assign whatever characters you want to IFS.

    (I have not tested any of this code, or examples.)

    Variable names

    The loop variable name i is just an identifier. Any valid variable name would work except you can't use the reserved names like $1, $2 or any keywords as names. Also, there's no way to escape an identifier. They are just literal names.

    You also don't want to use any built-in variable names or else you'll overwrite their values for the duration of the current session. Bash will happily let you use them as your looping variable, but the rest of your code might have undesirable results. Variable names like IFS, for instance. :D