zsh-users
 help / color / mirror / code / Atom feed
* Redirection and Variables
@ 2004-10-19 12:02 Nikolai Weibull
  2004-10-19 13:04 ` Peter Stephenson
  2004-10-21 13:57 ` Oliver Kiddle
  0 siblings, 2 replies; 7+ messages in thread
From: Nikolai Weibull @ 2004-10-19 12:02 UTC (permalink / raw)
  To: zsh-users

A couple of questions:

Is this the simplest way to do the following?

local -A http_programs https_programs mailto_programs ftp_programs

http_programs=(xw "/usr/bin/firefox -remote 'openURL(%s, new-tab)'"
               xt "/usr/bin/elinks '%s'")
http_programs=(xw "/usr/bin/firefox -remote 'openURL(%s, new-tab)'"
               xt "/usr/bin/elinks '%s'")
mailto_programs=(xt "/usr/bin/mutt '%s'")
ftp_programs=(xt "/usr/bin/lftp")

lookup () {
  echo "${(P)$(echo ${1}_programs\[xw\])}"
}

lookup http

If I have the following in a script that reads input from stdin:

sed -n "s/$REGEX/\1\n/gp" <&0 | sed "/$REGEX/!d" > $TMP
if [[ ! -s $TMP ]]; then
  rm -f $TMP
  exit 1
fi
${EDITOR:-vi} $TMP

my $EDITOR (vim) will complain that 
"Vim: Warning: Input is not from a terminal".  Is there a simple way to
get around this?
	nikolai


--
::: name: Nikolai Weibull    :: aliases: pcp / lone-star / aka :::
::: born: Chicago, IL USA    :: loc atm: Gothenburg, Sweden    :::
::: page: www.pcppopper.org  :: fun atm: gf,lps,ruby,lisp,war3 :::
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-10-21 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19 12:02 Redirection and Variables Nikolai Weibull
2004-10-19 13:04 ` Peter Stephenson
2004-10-19 13:51   ` Nikolai Weibull
2004-10-19 14:01     ` Peter Stephenson
2004-10-19 14:18       ` Nikolai Weibull
2004-10-21 13:57 ` Oliver Kiddle
2004-10-21 14:41   ` Nikolai Weibull

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).