How to prevent History Expansion in tcsh Shell?

Solution Verified - Updated -


  • Enclosing a string in single quotes fails to prevent History Expansion in tcsh Shell

    # history  | tail
         1  15:52   echo $?
         2  15:52   echo $0
         3  15:52   echo test
         4  15:52   history | tail
    # echo test!3test
    3test: Event not found.
    # echo 'test!3test'
    3test: Event not found.


  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • tcsh

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content