Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Redirection and Variables



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);}



Messages sorted by: Reverse Date, Date, Thread, Author