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

Re: 2 newbie ?s



On Jun 7,  2:46pm, Clint Adams wrote:
} 
} > That might actually be a bit *too* thorough ...
} 
} I agree with the sentiment, though you're discarding all the hostname
} information from /etc/hosts.

Ah, true.

    zstyle -e ':completion:*:ssh:*' hosts 'reply=(
	${=${${(f)"$(cat {/etc/ssh_,~/.ssh/known_}hosts(|2)(N) \
			 /dev/null)"}%%[# ]*}//,/ }
	${=${(f)"$(cat /etc/hosts(|)(N) <<(ypcat hosts 2>/dev/null))"}%%\#*}
	)'

I hate having to throw that /dev/null in there to keep `cat' from reading
stdin; one of those cases where I wish there were a glob-flag for turning
on csh_null_glob.  It's also annoying that $(<...) doesn't do filename
expansion or generation, which is why it has to use `cat' to begin with.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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