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

Re: my recent request for help



On Wed, 12 Apr 2000, Bill Trost wrote:

> Your original email message arrived an April 12th, along with your other two.
> It looks to me like your message got hung up at mout1.freenet.de before ever
> reaching the es list.  So, go put your teeth back in and complain to your Internet
> Service Provider (you did say you were gnawing on your own teeth...).

ok.  [mblgrschlpf].  if somebody has my original email still stashed(tm)
somewhere, please return it to me with all headers included, so i can tell
my isp about this nicety.

> A less expensive (subprocess-free) way to do what you want would be
> 	echo $list(<={%split $^ifs $i})

thanks.  to summarize, this is the final solution(also tm):

fn pick from {let (q=`` \n $from; qq=''; i='') {
	qq=$q
	while {!~ $#q 0} {                  # this contruct avoids the
		>/dev/tty echo $#q $qq($#q) # otherwise popular call
		q=$q(2 ...)                 # to `{expr $something + 1}
	}
	>/dev/tty echo -n '## ? '
	i = <={%split $^ifs <={</dev/tty %read}}
	echo $qq($i)
}}

the /dev/tty redirections have to be there in case the `from' part of the
pick sets them differently.
i use `pick' like this:

fn log { catch @ exc org msg {
		echo exception: $exc origin: $org
		echo message: $msg
		echo resuming std handler
		throw $exc $org $msg
	} {
		q = `{pick {ls -t /var/log/* | head -15}}
		$PAGER $q
	}
}

again, thanks for the feedback.

-- 
inode@freenet.de

[geeks: pgp+ scifi+ watch_entropy+ open_info+ --centralized(power&money)--]