• 33 Posts
  • 529 Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle







  • What’s the point of using Rust, if you don’t want to think and program in Rust? If you seriously don’t want to learn and deal with safe code and think every step of it in advance before compilation, then Rust is the wrong language for you. Either use a low level language like C and Zig, which gives you control over the system, but does not have a borrow checker. Or use a language with a runtime check that does this automatically for you without a borrow checker, like Go in example.








  • Basically an distribution that is not a rolling release. Its hard to recommend a specific distribution. You could use one of the Ubuntus, a Fedora Atomic variant, Mint, they should be able to run for weeks without issues. Unless you update a system component that requires a restart to take into effect. Why not openSUSE Leap?

    I’m personally on EndeavourOS, a rolling release and update often (even the Kernel). My PC is also on for 24h, usually for days, sometime even a week. One trick to avoid some of the restarts is to just logout and login the user. This should be no problem for you and at least some of the components start fresh due to login.






  • Thanks for posting. I find the echo part and extra use of variable is a little bit flaky. Here is a modified version. But I am not 100% sure if its doing what your script is doing.

    I skipped the extra variable and echo and grep, by comparing its content with ${*}, which is similar to ${@}, but won’t separate each argument and create a single string instead. The =~ /$ is a regex comparison, which Bash supports native. Then I am using ${@} for the call, which separates each argument. Maybe this could be done with ${*} instead. I’m not sure which of them is the correct one for this case. At least it seems filenames with spaces work. Otherwise, not claiming it would be better. Just giving some food for thoughts.

    #!/usr/bin/bash
    
    if [[ "${*}" =~ /$ ]]; then
        xargs -rd '\n' -I {} "${@}"{}
    else
        xargs -rd '\n' -I {} "${@}" {}
    fi