• 0 Posts
  • 12 Comments
Joined 2 years ago
cake
Cake day: July 3rd, 2023

help-circle





  • For loops with find are evil for a lot of reasons, one of which is spaces:

    $ tree
    .
    ├── arent good with find loops
    │   ├── a
    │   └── innerdira
    │       └── docker-compose.yml
    └── dirs with spaces
        ├── b
        └── innerdirb
            └── docker-compose.yml
    
    3 directories, 2 files
    $ for y in $(find .); do echo $y; done
    .
    ./are
    t good with fi
    d loops
    ./are
    t good with fi
    d loops/i
    
    erdira
    ./are
    t good with fi
    d loops/i
    
    erdira/docker-compose.yml
    ./are
    t good with fi
    d loops/a
    ./dirs with spaces
    ./dirs with spaces/i
    
    erdirb
    ./dirs with spaces/i
    
    erdirb/docker-compose.yml
    ./dirs with spaces/b
    

    You can kinda fix that with IFS (this breaks if newlines are in the filename which would probably only happen in a malicious context):

    $ OIFS=$IFS
    $ IFS=$'\n'
    $ for y in $(find .); do echo "$y"; done
    .
    ./arent good with find loops
    ./arent good with find loops/innerdira
    ./arent good with find loops/innerdira/docker-compose.yml
    ./arent good with find loops/a
    ./dirs with spaces
    ./dirs with spaces/innerdirb
    ./dirs with spaces/innerdirb/docker-compose.yml
    ./dirs with spaces/b
    $ IFS=$OIFS
    

    But you can also use something like:

    find . -name 'docker-compose.yml' -printf '%h\0' | while read -r -d $'\0' dir; do
          ....
    done
    

    or in your case this could all be done from find alone:

    find . -name 'docker-compose.yml' -execdir ...
    

    -execdir in this case is basically replacing your cd $(dirname $y), which is also brittle when it comes to spaces and should be quoted: cd "$(dirname "$y")".


  • I love nix and NixOS, but yes the documentation is incredibly insufficient. I’d recommend a normal distro + the nix package manager first for a personal laptop. You have be ok occasionally taking a detour to learn how to build some random program from source in a sandbox with no networking every once in a while so it’s kinda clunky as a daily use OS imo. It shines on servers though


  • NixOS is fun but requires tinkering for a desktop/laptop. You can use the nix package manager on any other distro though. At work I use Fedora and still use the nix package manager a ton when I want to, but I’m not locked into it when something needs to just work quickly. I have NixOS on my personal laptop and I kinda wish I didn’t. I have it on my home server and I’m very happy I did that.



  • qqq@lemmy.worldtocats@lemmy.worldHow on earth?
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    4 months ago

    You shared a Wikipedia link with sources[1] (and also numerous sections and assertions in the Wikipedia article itself) showing that cats generally impact wildlife populations but came to the conclusion that they don’t. Am I missing something here? Is it because you’re specifically focusing on birds?

    [1] https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/1365-2656.13745

    5 CONCLUSIONS

    Free-roaming domestic cats affect wildlife through predation, disease, hybridization, and indirect fear and competition effects. Our review highlights biases and gaps in the global literature on these impacts, including a focus on oceanic islands, Australia, Europe and North America, and on rural areas, predation, impacts of unowned cats, and impacts at population and species levels. Key research advances needed to better understand cat impacts include more studies in underrepresented regions (Africa, Asia, South America), on impacts other than predation, and on management methods designed to reduce impacts. This review also supports past studies in illustrating that cats negatively affect wildlife populations and communities in most cases in which these potential impacts were evaluated


  • qqq@lemmy.worldtocats@lemmy.worldHow on earth?
    link
    fedilink
    arrow-up
    0
    ·
    4 months ago

    Beyond the bird or wildlife problem, outdoor free roaming cats are just generally a problem. I have two cats and an outdoor cat likes to come and taunt them at the window: it seriously stresses them out. It’ll go so far as climbing up screens and damaging them. Cats will also often mark people’s houses.

    I walk my cats on leashes. I don’t understand why cat owners can’t understand that people don’t want their cat around unmanaged.