Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Redirection and Variables
- X-seq: zsh-users 8072
- From: Nikolai Weibull <zsh-users-list@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Redirection and Variables
- Date: Tue, 19 Oct 2004 14:02:20 +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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