}

Silver Searcher: Can't Search for Dollar Sign

The problem: double quotes

I tried searching my project for the angularJS service $timeout using ag. I tried the following:

$ ag "\$timeout"

However no results were returned.

Cause of the problem is that you're using double quotes, you're only escaping the dollar sign..

Solution 1: Single quotes

ag '\$timeout'

Solution 1: Proper escape

$ ag "\\\$timeout"

Leonardo Lazzaro

Software engineer and technical writer. 10+ years experience in DevOps, Python, and Linux systems.

More articles by Leonardo Lazzaro