From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 798 invoked from network); 8 Dec 2003 12:26:04 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 8 Dec 2003 12:26:04 -0000 Received: (qmail 6297 invoked by alias); 8 Dec 2003 12:25:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6845 Received: (qmail 6267 invoked from network); 8 Dec 2003 12:25:39 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 8 Dec 2003 12:25:39 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [80.91.224.249] by sunsite.dk (MessageWall 1.0.8) with SMTP; 8 Dec 2003 12:25:39 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1ATKSJ-0001mo-00 for ; Mon, 08 Dec 2003 13:25:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@sunsite.dk Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ATKSH-0001me-00 for ; Mon, 08 Dec 2003 13:25:37 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1ATKSH-0006Xp-00 for ; Mon, 08 Dec 2003 13:25:37 +0100 From: zzapper Subject: Stopping functions breaking Date: Mon, 08 Dec 2003 12:25:35 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Newsreader: Forte Free Agent 1.93/32.576 English (American) Sender: news Hi I'm writing a function (see below) which I call such > pub fred I want it to cd to any directory beginning fred, if there 0 or more than 1 matches I wish to carry on in the script. However whatever I try 0 or no matches breaks the script. HELP PLEASE function pub { if [ $# -gt 0 ]; then echo $? builtin chdir $1* &> /dev/null echo $? zzapper -- vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?" http://www.vim.org/tips/tip.php?tip_id=305 Best of Vim Tips