On Saturday, 13 May 2023 at 13:36:03 UTC+5, Kerr-Mudd, John wrote:...
On Fri, 12 May 2023 23:53:16 -0700 (PDT)
Muhammad Usman <[email protected]> wrote:
I got the solution just after 26 years. Use single quotes such as... and changing OS.
echo -e '<!DOCTYPE html>'
will solve the issue.
If we use double quotes, it will surely raise an error.
echo -e "<!DOCTYPE html>"
```bash: !DOCTYPE: event not found```
I was doing it on bash shell linux. Never tried it on DOS or windows
On 2023-06-14, Kenny McCormack wrote:
MU == Muhammad Usman <[email protected]> wrote:
I got the solution just after 26 years. Use single quotes such as
echo -e '<!DOCTYPE html>'
will solve the issue.
Anyway, believe it or not, it is not the angle brackets that are
giving you grief (see below - *); rather, it is the exclamation point
(!). You need to read up on the topic of "history substitution" in
"man bash".
(*) Basically, either single or double quotes will protect angle
brackets, but you need single quotes to protect "!".
On 2023-06-14, Kenny McCormack wrote:
MU == Muhammad Usman <[email protected]> wrote:
I got the solution just after 26 years. Use single quotes such as
echo -e '<!DOCTYPE html>'
will solve the issue.
[...]
Anyway, believe it or not, it is not the angle brackets that are
giving you grief (see below - *); rather, it is the exclamation point
(!). You need to read up on the topic of "history substitution" in
"man bash".
(*) Basically, either single or double quotes will protect angle
brackets, but you need single quotes to protect "!".
It's also possible to disable history substitution altogether
with 'set +H'.
I believe this behavior is rather confusing to new users, and
given that C-r (reverse-search-history) and cursor keys already
offer a comparable feature, and one likely to fit better with
user's prior experience at that, my suggestion would be to
have it disabled by default.
Ivan Shmakov <[email protected]d> writes:[...]
(*) Basically, either single or double quotes will protect angle brackets, but you need single quotes to protect "!".
It's also possible to disable history substitution altogether
with 'set +H'.
That's been my preference for some time. It was useful decades ago (in
csh if I recall correctly) but I never want it anymore.
On Thu, 15 Jun 2023 23:40:31 +0100
Ben Bacarisse <[email protected]> wrote:
Ivan Shmakov <[email protected]d> writes:[...]
(*) Basically, either single or double quotes will protect angle
brackets, but you need single quotes to protect "!".
It's also possible to disable history substitution altogether
with 'set +H'.
That's been my preference for some time. It was useful decades ago (in
csh if I recall correctly) but I never want it anymore.
I use history substitution all the time. Most often I use !:$ or !:$:h or !:$:t with the $ occasionally replaced by a command number. I've never had to consciously remember any rules regarding how the ! is expanded.
On Thu, 15 Jun 2023 23:40:31 +0100
Ben Bacarisse <[email protected]> wrote:
Ivan Shmakov <[email protected]d> writes:
(*) Basically, either single or double quotes will protect angle brackets, but you need single quotes to protect "!".
[...]It's also possible to disable history substitution altogether
with 'set +H'.
That's been my preference for some time. It was useful decades ago (in
csh if I recall correctly) but I never want it anymore.
I use history substitution all the time. Most often I use !:$ or !:$:h or !:$:t with the $ occasionally replaced by a command number. I've never had to consciously remember any rules regarding how the ! is expanded.
I used to use !:$ but Alt-. has taken over.
The other two tcsh left-overs, ^ (like in ^sl^ls) and !* are handled by
r sl=ls
On the other hand, M-. also seems to work in Zsh, and it's fewer keystrokes than !$<Tab>. I'll try to remember it next time I need this!
So I can cover [snip]
!$
with
M-. (interactive)
or
$_ (blind)
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 07:11:04 |
| Calls: | 12,100 |
| Calls today: | 8 |
| Files: | 15,003 |
| Messages: | 6,517,927 |
| Posted today: | 1 |