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

```
It turns out you're asking the wrong question. I also asked the wrong question. The reason it's wrong is the beginning of the first sentence: "In my bash script...".

I had the same question & made the same mistake. If you're using bash, you don't need to use sed to do string replacements (and it's much cleaner to use the replace feature built into bash).

Instead of:

```
  keysalts=`curl -sS https://api.wordpress.org/secret-key/1.1/salt/`
  sed -i "s/{AUTH-KEYS-SALTS}/$keysalts/g" wp-config.php

```

you can use bash features exclusively, reading the file into a variable, replacing the text in the variable, and writing the replaced text back out to the file:

```
  INPUT=$(<wp-config.php)
  keysalts="$(curl -sS https://api.wordpress.org/secret-key/1.1/salt/)"
  echo "${INPUT//'{AUTH-KEYS-SALTS}'/"$keysalts"}" >wp-config.php

```