Skip to Content
Using csh & tcsh
book

Using csh & tcsh

by Paul DuBois
July 1995
Beginner to intermediate
244 pages
5h 58m
English
O'Reilly Media, Inc.
Content preview from Using csh & tcsh

The Shell's Quote Characters

Four characters are used for quoting. They turn off (or "escape") special character meanings:

  • A backslash (\) turns off the special meaning of the following character.

  • Single quotes ('') turn off the special meaning of the characters between the quotes, except that !event still indicates history substitution.

  • Double quotes ("…") turn off the special meaning of the characters between the quotes, except that !event, $var, and `cmd` still indicate history, variable, and command substitution. (You can think of double quotes as being "weaker" than single quotes because they turn off fewer special characters.)

  • The lnext ("literal next") character turns off the special meaning of the following character.[20] This character can be used with special characters that are otherwise interpreted as soon as they are typed. For example, in tcsh a TAB triggers filename completion; therefore, you cannot type a literal TAB unless you precede it with CTRL-V.

Quoting the Quote Characters

The quote characters can be used to type literal quote characters, not simply to turn off the special meaning of other special characters.

Backslash and CTRL-V quote themselves. In other words, \\ produces \ and CTRL-V CTRL-V produces CTRL-V.

Single and double quote marks quote each other:

% echo "'" '"'
' "

Backslash quotes quote marks:

% echo \' \"
' "

And quote marks quote backslashes:

% echo '\' "\"
\ \

The following sections describe several practical methods of using the quote characters.

[20] ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Linux Shells by Example

Linux Shells by Example

Ellie Quigley

Publisher Resources

ISBN: 9781449377526Errata Page