Re: [dev] [dmenu] dmenu_run improvements

From: Dave Reisner <d_AT_falconindy.com>
Date: Sun, 24 Jul 2011 09:51:06 -0400

On Sun, Jul 24, 2011 at 02:09:54PM +0100, Connor Lane Smith wrote:
> On 24 July 2011 06:34, Dave Reisner <d_AT_falconindy.com> wrote:
> > if [ "$path" -nt "$CACHE" ]; then
>
> 'test -nt' is non-portable. I think you've just discovered why we use
> the 'ls -dt' hack.

Hrmmph, so it is... the doc I had on hand lied to me.

> I agree that dmenu_run isn't the nicest script in existence. But
> because of the tedious limitations of POSIX we don't have much choice.

There's always a choice. Consider using find, then:

  IFS=:
  if test -n "`find $PATH -type d -prune -newer "$CACHE"`"; then
    # regen the cache
  fi

http://pubs.opengroup.org/onlinepubs/009604599/utilities/find.html

> On 24 July 2011 13:13, lolilolicon <lolilolicon_AT_gmail.com> wrote:
> > cmd=`dmenu "$@" < "$CACHE"` || exit $?
> > exec sh -c "$cmd"
>
> This could work, I think. I'll check it out.
>
> Thanks,
> cls
>
Received on Sun Jul 24 2011 - 15:51:06 CEST

This archive was generated by hypermail 2.2.0 : Sun Jul 24 2011 - 16:00:05 CEST