Feel free to edit this page to suggest tools to add, or make any other comments --Joey
vidir
A suggestion regarding vidir: I would find it quite useful if vidir could work with version control system commands like:
svn mv
svn rm
or
git mv
git rm
Another improvement would be the addition would be to add checkboxes to control which files should be controlled by the vcs and which shouldn't.
-- David Riebenbauer
What I want to do with vidir is make it able to run arbitrary configured commands based on filename transformations. So that it can be configured to run git add, or svn rm or whatever. Also so that if you remove .gz from a filename, it's decompressed; adding .gz compresses it, etc. I have not figured out a configuration language that is flexible enough to handle all these cases though. --Joey
url2file
New tool url2file as found at http://specs.dachary.org/url2file/ : the idea is to be able to do wc -l $(url2file http://foo.com/)
See the
dogutility from the package by that name.
ifne
I'm suggesting a command that would run the following command if and only if the standard input is not empty. I often want this in crontabs, as in:
find . -name core | ifne mail -s "Core files found" root
This is a good idea, and included now.
autopage
A command that pages the stdout of a subcommand only if stdout is a tty, similar to the way git treats its stdout. For example:
autopage ls -l
works like "ls -l | pager" but
autopage ls -l >mifilelist
works correctly and writes the output of "ls -l" in "myfilelist". This command would be useful for aliases, so you could add git's autopaging to other commands like this:
alias ls="autopage ls"
--Vicho
Might the generic unix tool that's missing here really be a command-line version of "isatty"? I like to think generic; running a pages if isatty is a specific case that can be done with a small shell script. --Joey
The generic unix tool is "test -t 1", so probably this shouldn't go on moreutils. Still I like the autopaging capability of
gitand I miss them in commands likegreporls. On the other hand, I don't think every command should check if its stdout is a tty and run a pager if its output is larger than a screen. I think this should be done in a more general way, like globbing.--Vicho
moreutils tricks
Look at this poor man's hex editor, made with moreutils (and xxd)
xxd $file | vipe | xxd -r | sponge $file
For me 'vipe' is the killer app in moreutils, I hardly use the other (but I think it just takes getting used to the new repertoire). --ulrik.
That's sweet. I never thought of using vipe for that, which is of course, the point. Amusingly, for me, vipe is one of the rarer used tools. :-) --Joey
URI to local path converter
This shell problem pops up in shell scripting for Nautilus and some other gnome applications. I'm proposing a tool to convert between file:/// URIs and local paths, with the proper encoding conversions in that of course.
Interface:
$ tourl "/tmp/my dir/idx.html"
file:///tmp/my%20dir/idx.html
$ tolocal "file://localhost/home/ben/Documents/report%202008.pdf"
/home/ben/Documents/report 2008.pdf
Just a suggestion, easily solved using most high-level desktop APIs. Is there already a shell tool? --ulrik
I imagine there's a perl oneliner that can do it. It doesn't seem generic enough for morutils. --Joey