It's funny that `vidir` spawns `nano` by default on my system.
$ update-alternatives --list editor
11–20 of 225 posts
It's funny that `vidir` spawns `nano` by default on my system.
$ update-alternatives --list editor
It's funny that `vidir` spawns `nano` by default on my system.
Earlier quoted context omitted.
> Why not use > file? I'm assuming sponge buffers everything in memory so you don't get concurrent modification bugs.
Yes, if you try to sed a file back to itself for instance you'll get a truncated file (or maybe a no-op?). In fact, that's exactly the example sponge's manpage uses.
Earlier quoted context omitted.
> Why not use > file? I'm assuming sponge buffers everything in memory so you don't get concurrent modification bugs.
Yes, if you try to sed a file back to itself for instance you'll get a truncated file (or maybe a no-op?). In fact, that's exactly the example sponge's manpage uses.
$ cat test
moo
$ cat test
$ cat test
$But what immediately stood out to me is `vidir`. I really like the idea of editing file names with an editor. Using loops and regex in a shell for mass renaming can be a mess. It should be way easier with `vim`. This tool made me install moreutils.
I wrote a util a bit like this when I realised there was no command for emptying a directory: https://github.com/adamserafini/emptydir
I wrote a util a bit like this when I realised there was no command for emptying a directory: https://github.com/adamserafini/emptydir
What the difference in just deleting the whole directory and recreating it with `mkdir`. Or just do an `rm -rf dir/*`?
Earlier quoted context omitted.
Yes, if you try to sed a file back to itself for instance you'll get a truncated file (or maybe a no-op?). In fact, that's exactly the example sponge's manpage uses.
It's a truncated file: $ cat test moo $ cat test $ cat test $
$ cat test
moo
$ cat /dev/null
$ cat test
moo
...seems to work. Am I just getting lucky with a race condition?