Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Strange escaped < > behaviour
- X-seq: zsh-users 13896
- From: Matt Wozniski <godlygeek@xxxxxxxxx>
- To: Jerry Rocteur <macosx@xxxxxxxxxx>, zsh-users@xxxxxxxxxx
- Subject: Re: Strange escaped < > behaviour
- Date: Wed, 11 Mar 2009 05:50:49 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ICwOuAuGvF+KNjZaUAwgMOAt3DAVMDus6N/t2HfLCDg=; b=mSVwfe4ZA5Noud8SJ3W32KHVz5Z5F8kT4YJMQTdZFgq8frzoUipze1EGMit6OuaLo6 Kol8HMXC+GcFPFe4JIZFHJBRn8pGkZh8ZkI5tO9oeWErkHeLvCs9qYMFpgolF3UX+ZCl Evbhlu3kLpmM+jE326TRQtv9nkJkf+369iQcQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=bGwhWbQzCaU5kbzw2K5tLe5p4Q4qZ5SqC/JneTr+iFN+WK07w+t5Syxt+nlgF2d2D5 JBFriitghj3vTisaj9IigjD5yfGw/zhStaan5f8oUpm86No1xvjQYVXxTH8Y8pVWShUV uxvZomY7ll5Y8652AvgBFSJ6o3DJdXwn6g4jY=
- In-reply-to: <57016.153.98.68.197.1236759758.squirrel@xxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <57016.153.98.68.197.1236759758.squirrel@xxxxxxxxxxxxxxxxxxx>
On Wed, Mar 11, 2009 at 4:22 AM, Jerry Rocteur wrote:
> Hi,
>
> We have a bunch of scripts that work on KSH and PDKSH like this:
>
> echo ' Â Â Â ÂULOGPFX Â Â Â Â= "<WORK_DIR>/ULOG"' | sed 's/.*\<\(.*\)\>.*/\1/'
> WORK_DIR
>
> Don't ask me why the escaped the < and > above but the scripts have been like this for a LONG LONG time!
>
> Now with ZSH I get this behaviour
>
> echo ' Â Â Â ÂULOGPFX Â Â Â Â= "<WORK_DIR>/ULOG"' | sed 's/.*\<\(.*\)\>.*/\1/'
> ULOG
>
> The easy way to fix it is to remove the back slash in front of the < and >
>
> However this is VERY annoying.
>
> Why does the above give us ULOG and why does this differ from the KSH and PDKSH.
I'm going to go *way* out on a limb with my assumptions here, but,
here goes: You're clearly doing this on a non-linux unix, since Linux
would use gnu sed, where \< and \> are special and different from <
and >. If you were on Linux, your script would never have worked.
So, my huge assumption would be to guess that you probably put paths
to gnu versions of tools in your path. I know I did the last time I
was stuck using Solaris. So, my best guess is that your $PATH is set
differently on zsh than in ksh or pdksh, causing zsh to call a version
of sed where \< and \> match word boundaries, instead of matching <
and >. Change your $PATH, or use an absolute path to the sed binary
that works with pdksh, and I'm guessing things will just work.
~Matt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author