From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Wed, 30 Jan 2008 13:04:58 +0000 From: "roger peppe" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] quouteing(?) problems in rc In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Topicbox-Message-UUID: 3cd2e1ba-ead3-11e9-9d60-3106f5b1d025 > grep -n -e '''' ^ '^' ^ $func ^ '''' $file /dev/null your problem is that you're constructing a list containing quotes suitable for input to the shell, but you really want to construct a list containing values suitable for arguments to grep. i think what you want is: grep -n -e '^'^$func $file /dev/null which of course will only work correctly if $func contains no regexp metacharacters, but i'm sure you know that.