Question: I have a function here that finds the sibling(answerfields) of the parent(li) then counts the child inputs.

```
$('#addAnswer').live('click', function(){
    var selected = $(this).parents('li').siblings('#answerFields').children('input').length;
    document.getElementById('legend').innerHTML = selected;
});

```

How can i shorten this up using Jquery 1.5.2?

I have a working [JSFiddle](http://jsfiddle.net/rayd360/bPp8a/).

Answer: 
Other way could be using `perl`:

```
perl -i -pe '
  BEGIN { 
    $keysalts = qx(curl -sS https://api.wordpress.org/secret-key/1.1/salt) 
  } 
  s/{AUTH-KEYS-SALTS}/$keysalts/g
' wp-config.php

```
You can escape `$keysalts` using sed itself:

```
sed -i "s/{AUTH-KEYS-SALTS}/`echo $keysalts | sed -e 's/[\/&]/\\&/g'`/g" wp-config.php

```

See [this question](https://stackoverflow.com/questions/407523/escape-a-string-for-sed-search-pattern) for more information.