• 6 Posts
  • 402 Comments
Joined 5 years ago
cake
Cake day: May 31st, 2020

help-circle
  • somewhat logical, but entirely in practice verb-noun command structure.

    That’s supposed to be “impractical”, not “in practice”, for others reading along.

    For example, the “proper” command to list a directory is: Get-ChildItem
    The “proper” command to fetch a webpage is: Invoke-WebRequest https://example.com/

    In these particular cases, they do have aliases defined, so you can use ls, dir and curl instead, but …yeah, that’s still generally what the command names are like.

    It’s partially more verbose than C#, which is one of the most verbose programming languages out there. I genuinely feel like this kind of defeats the point of having a scripting language in the first place, when it isn’t succinct.
    Like, you’re hardly going to use it interactively, because it is so verbose, so you won’t know the commands very well. Which means, if you go to write a script with Powershell, you’ll need to look up how to do everything just as much as with a full-fledged programming language. And I do typically prefer the better tooling of a full-fledged programming language…




  • Ephera@lemmy.mltoLinux@lemmy.mlLinux security
    link
    fedilink
    English
    arrow-up
    37
    ·
    4 days ago

    I just want to say that you’re probably worrying too much about it. Of course, there is lots of things one can do to improve security (which the others here are listing dutifully) and it is foolish to just assume that one’s computer is entirely secure, because as a user, you will always have the ability to bypass that.

    But there’s a pretty firm consensus in the IT industry that Linux is more secure than Windows. And that the popular Linux distributions are more trustworthy organizations than Microsoft.

    So, it’s good to inform yourself, but if you survived on Windows, you at least should not worry about the Linux side of things. It’s more than fine.



  • Ephera@lemmy.mltolinuxmemes@lemmy.worldFish rules
    link
    fedilink
    English
    arrow-up
    4
    ·
    9 days ago

    Fish is not the worst in this regard, because:

    • The defaults are pretty good, so you don’t typically need a config file for it to be usable.
    • As of version 4.0, Fish is (experimentally) available as a single executable for download from their GitHub page. So, even on hosts where you can’t install anything, you may still be able to copy that executable file onto there and use it.

    But there may still be situations where it’s annoying, like if you’re working in a container, then you likely don’t want to mount your fish executable every time.

    But I also have to say I don’t find it too big of a deal.
    I still use Bash for scripting (just throw a #!/bin/sh or #!/bin/bash at the top of your script, like you should anyways), and then for interactive use, not that much of the shell syntax comes into play anyways.
    And if I ever do need to copy a complex Bash command into an interactive shell, I can just run bash, then run the command in there and then exit back out.


  • Eh, as much as there’s obviously folks who use certain distros for the fun of it, the vast majority of distros get created to cover a specific use-case. If you have that use-case, then deploying the respective distro brings you so much closer to your target setup than the easy installation of a noob distro could save you time.

    I also have to say, many stereotypical noob distros make extremely conservative choices, which makes them harder or scarier to use in various ways, like for example not having filesystem rollback. I cannot imagine going back to that, specifically because I have shit to do.



  • Probably the very same thing that the post talks about, which is extracting the first word of a line of text.

    The output of md5sum looks like this:

    > md5sum test.txt
    a3cca2b2aa1e3b5b3b5aad99a8529074 test.txt
    

    So, it lists the checksum and then the file name, but you wanted just the checksum.


  • It’s a Linux command-line program (awk). It’s pre-installed practically everywhere, it’s very powerful for string processing, but it also uses a fairly complex syntax.

    As a result, not many people know how to really make use of it, but awk '{print $1}' is something you encounter fairly quickly when you need to get the first word in each line.



  • Ephera@lemmy.mltolinuxmemes@lemmy.worldsiempre lo hago
    link
    fedilink
    English
    arrow-up
    5
    ·
    23 days ago

    With script files, you can (and should regardless of Fish usage) put a shebang at the top, like #!/bin/sh or #!/bin/bash. Then it will run with Bash as you’d expect.

    I also recommend not setting Fish as your system-wide default shell (since then a missing shebang will cause it to run in Fish), but rather just have your terminal emulator start fish by default.

    And yeah, outside of scripting, if I notice a command requires Bash syntax (which you can often tell from Fish’s syntax highlighting turning red), then I just run bash, execute the Bash command in there and then exit back out of there.

    Having said all that, I’m not trying to take away from your point. If I wasn’t just joking around, I would caveat a Fish recommendation just as much.