Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parameter expansion bug?
- X-seq: zsh-workers 2306
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Hrvoje Niksic <hniksic@xxxxxxx>, Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- Subject: Re: Parameter expansion bug?
- Date: Thu, 31 Oct 1996 09:47:40 -0800
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: Hrvoje Niksic <hniksic@xxxxxxx> "Re: Parameter expansion bug?" (Oct 31, 5:57pm)
- In-reply-to: Zoltan Hidvegi <hzoli@xxxxxxxxxx> "Re: Parameter expansion bug?" (Oct 31, 6:04pm)
- References: <199610311612.RAA27218@xxxxxxxxxxxxxxxxx> <961031085509.ZM5934@xxxxxxxxxxxxxxxxxxxxxxx> <kigiv7rhy0s.fsf@xxxxxxxxxxxxx> <199610311704.SAA27945@xxxxxxxxxxxxxxxxx>
- Reply-to: schaefer@xxxxxxx
On Oct 31, 5:57pm, Hrvoje Niksic wrote:
} Subject: Re: Parameter expansion bug?
}
} Bart Schaefer (schaefer@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
} > On Oct 31, 5:12pm, Zoltan Hidvegi wrote:
} > } How do you print -n under bash?
} > As nearly as I can tell, `echo -e -n` is the only way.
}
} It doesn't work for me:
}
} `-e' in bash is used to enable interpretation of control sequences
} like \n.
Yes, I know.
On Oct 31, 6:04pm, Zoltan Hidvegi wrote:
} Subject: Re: Parameter expansion bug?
}
} Perhaps you wanted to write
}
} echo -e '\55n'
No, I see how I confused myself. I was trying various combinations like
`echo \\-n` and got as far as:
bash$ echo -e -n\\n
-n
bash$
And then mistakenly though that this meant that only the first parameter
that began with a `-' was interpreted (e.g. that `echo -ne` was required
to get both escapes and no newline), and thus that `echo -e -n` would
work, when in fact it was the presence of the \\n that was causing the
second word to not be interpreted as a switch.
But `echo \\55n` is easier than `echo -ne -n\\n` ...
Interestingly, GNU echo ignores the -e switch; you have to give it -E to
shut off escapes. So `echo ...` and `/bin/echo ...` aren't the same on
my machine, though they accept the same switches. Isn't bash GNUware?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.nbn.com/people/lantern
Messages sorted by:
Reverse Date,
Date,
Thread,
Author