Re: [dev] Re: dmenu's lsx binary naming conflicts with lrzsz!

From: Connor Lane Smith <cls_AT_lubutu.com>
Date: Mon, 28 Nov 2011 15:06:03 +0000

On 28 November 2011 14:43, Christian Neukirchen <chneukirchen_AT_gmail.com> wrote:
> All supported except for -maxdepth, but you can use:
>
> find -L . -type d \! -name . -prune -o -type f -perm -111 -print

I've seen things like this before. All it does is prove how much find
needs replacing. I'm considering using stest (lstest?) to reduce
dmenu_run to something like:

> #!/bin/sh
> (
> IFS=:
> cache=${XDG_CACHE_HOME:-"$HOME/.cache"}
> if stest -dqr -n "$cache/dmenu_run" $PATH; then
> mkdir -p -m 0700 "$cache"
> stest -flx $PATH | sort -u | tee "$cache/dmenu_run" | dmenu "$_AT_"
> else
> dmenu "$_AT_" < "$cache/dmenu_run"
> fi
> ) | exec ${SHELL:-"/bin/sh"}

This seems far nicer, to me, than some find monstrosity.

cls
Received on Mon Nov 28 2011 - 16:06:03 CET

This archive was generated by hypermail 2.3.0 : Mon Nov 28 2011 - 16:12:05 CET