You’re on a linux-y machine and you want to convert tabs in a file to spaces (say, two) and your editor doesn’t support that (hello, Helix ):
expand my.file -t 2 > my.file.tmp && mv my.file.tmp my.file
(Updated as original version just deletes the original file.)
(Or pipe to sponge but sponge isn’t available by default.)
@aral now with the edit, it doesn't delete the original, it just does nothing and produces an error for mv. Remove the rm entirely and it will work.
@mschulkind Oh, ffs, fixed it (thanks) :)
(Don’t toot while coding is the lesson here, I think.)