[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sh-utils contribution: pick & cleanname

From: Leonard Stiles
Subject: sh-utils contribution: pick & cleanname
Date: Sat, 23 Sep 2000 16:36:44 +0200
User-agent: Mutt/1.2i

(This message is intended for the maintainer of the sh-utils. Although this 
is not a bug report, I'm sending it to this address as it is not immediately 
evident who the current maintainer of the package is)

I've written implementations of two small tools which I find useful, and 
which I believe would prove a nice addition to the sh-utils package.

The first is cleanname, based on a utility from Plan 9, which prints the 
shortest pathname equivalent to each path specified as an argument.
eg. `cleanname foo/.././bar//baz/` returns 'bar/baz'
This would fit in nicely alongside basename and dirname

The second is pick, an implementation of the tool described in Brian 
Kernighan and Rob Pike's book 'The Unix Programming Environment'
pick prompts the user for a response for each of its arguments, and echoes 
the argument if the user replies `y'
e.g. gzip `pick *.ps`
lets the user interactively select postscript files in the current directory 
to be compressed.

The attached source code should work `out of the box' when placed in the 
src/ subdirectory; if you decide to use the programs I could write some 
documentation for them as well.

| Leonard Stiles <address@hidden> |

Attachment: cleanname.c
Description: Text document

Attachment: pick.c
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]