You're completely missing the point/philosophy of how Linux uses RAM.
RAM is a wasted resource if it's completely free and the OS is having to access the HDD for files, therefore in Linux it maintains buffers & cache which use up RAM aggressively to improve performance.
This RAM can be used by a process at any time (it's effectively cache).
Reading from a disk is very slow compared to accessing (real) memory. In addition, it is common to read the same part of a disk several times during relatively short periods of time. For example, one might first read an e-mail message, then read the letter into an editor when replying to it, then make the mail program read it again when copying it to a folder. Or, consider how often the command ls might be run on a system with many users. By reading the information from disk only once and then keeping it in memory until no longer needed, one can speed up all but the first read. This is called disk buffering, and the memory used for the purpose is called the buffer cache.
Reference: http://www.tldp.org/LDP/sag/html/buffer-cache.html
Example
$ free -hw
total used free shared buffers cache available
Mem: 992M 76M 202M 12M 68M 645M 739M
Swap: 2.0G 0B 2.0G
In this output my VM has ~992MB of which it appears as if it's only got 202MB free. But this is where many get confused/misled.
This Linux system actually has 739MB free (available column).
How is this possible?
Simple. Linux is using RAM to improve performance by holding files, libraries, etc. in RAM (buffers & cache) rather than have to reach out the slow HDD to retrieve these files each time.
The buffers & cache are use by the Linux kernel in this manner, and at any point if the memory manager (part of the kernel) perceives pressure where processes are requiring more and more RAM, the kernel can literally drop any of the data that's being cached here to immediately give itself more RAM.
Your question
As far as your question is concerned with the clearcache.sh
script. The answer is simple. That's a typo by whomever wrote the article. It should be like this:
$ echo "echo 3 > /proc/sys/vm/drop_caches" | sudo sh
They probably copy/pasted incorrectly from my U&L Q&A answer to this question: How do you empty the buffers and cache on a Linux system?
References