Question: ```
myapp.log.2015-03-31:in<username|password>version=1.1.8,type=Login

```

I want to print only "username" and "version" from this line. If I use 

```
grep -o "username"

```

it will print only *usernames*. Similarly if I use

```
grep -o "version.*,"

```

it will print out all version numbers. Is there any way that I could print both *username* and *version* number together?

like 

```
"username" version=1.1.8,

```

Answer: 
You shouldn't cache your setup block - this means that your `options` and `opts_chunk$set` won't be run on subsequent calls of `knit()`. `cache = TRUE` should be used for blocks of code that produce results where if the code hasn't changed, the results won't have changed either. However, you also need to be careful of dependencies.

See <http://yihui.name/knitr/demo/cache/> for more detail. Look in particular at the section labelled 'Important notes' which has the following:

> 
> It is extremely important to note that usually a chunk that has
>  side-effects should not be cached. Although knitr tries to retain the
>  side-effects from print(), there are still other side-effects that are
>  not preserved. Here are some cases that you must not use cache for a
>  chunk:
> 
> 
> 1. setting R options like `options('width')` or `pdf.options()` or any other options in knitr like `opts_chunk$set()`, `opts_knit$set()` and
>  `knit_hooks$set()`
> 2. loading packages via `library()` in a cached chunk and these packages will be used by uncached chunks (it is entirely OK to load
>  packages in a cached chunk and use them only in cached chunks because
>  knitr saves the list of packages for cached chunks, but uncached
>  chunks are unable to know which packages are loaded in previous cached
>  chunks)
> 
> 
> Otherwise next time the chunk will be skipped and all the settings in
>  it will be ignored. You have to use `cache=FALSE` explicitly for these
>  chunks.
> 
> 
>
You have to set `cache = F`. I think the reason is that with `cache = TRUE` the second time the code is stored in memory and the `echo = F` is ignored.