StephenJungels.com :: Open source :: Projects :: interactive.c

Interactive.c takes standard input or files and processes each line interactively by letting the user vote yes or no on it. It is possible to move up levels in the hierarchy (a directory hierarchy, for example) and vote on entire branches at once. It is also possible to mass vote and search in the list.

Interactive is intended to be used in scripts and pipelines to implement "fancy interactive" mode, for example

find /music -type f -iname "*.mp3" | sort | \
interactive --prefix=/music/ | xargs -i mpg123 {}

It would be typical to sort the input to interactive, but that is not a requirement. Use --help to see all the options. Interactive was originally an Awk program and it might be interesting as an example of translating from Awk to C (you might also want to check out Awka).

You may have to fiddle with this code to make it compile on your system. A simple "gcc interactive.c -o interactive" should work. The latest version of interactive seems to be free of buffer overflows and segfaults, but it isn't tested extensively and should be considered deep beta.

Source