I have made a CLI app, it would require arbitrary disk access, as it is a dev tool.
Basically what it does is that it integrates with other CLI tools to provide a pretty neat and modern regex search and replace over a large (or small) number of files.
The code available here: https://github.com/ms-jpq/sad
Here is a gif of it in action:
As you may see, this tool is intended to edit arbitrary files, including system files.
I have published a “devmode” version here https://snapcraft.io/sad. unfortunately, it does not work 100%, since it is still sandboxed. to try out a working version you would have to download the deb files from my github release.
I put the
snapcraft.yml along with my other CI artifacts, so I can keep some consistency every time I do a release.
It would be really helpful if I could receive an approval for making this CLI available via classic.
an example of using
sad to edit system file would be
echo /etc/hosts | sad '(127.0.1.1) [^ ]+$' '$1 newhostname'
this allows you to safely edit the hosts file, and preview the change before you hit enter to commit.