Question: Basically I want to copy several lines of code from a template file to a script file.
Is it even possible to use `sed` to copy a string full of symbols that interact with the script?

I used these lines:

```
$SWAP='sudo cat /home/kaarel/template'
sed -i -e "s/#pointer/${SWAP}/" "script.sh"

```

The output is: 

```
./line-adder.sh: line 11: =sudo cat /home/kaarel/template: No such file or directory

```

Answer: 
So as I explained in the answer to [this question](https://stackoverflow.com/questions/15153349/meteor-subscribe-doesnt-update-sort-order-of-collection), sorting in the publish function has no affect on the order of documents on the client. So you should see the same result if you do:

```
Meteor.publish "families", ->
  Families.find()

```

As for your template data, that **should** specify the sort (your second choice). It may be that both options yield the same result because of their insertion order but that's coincidental.
Not being expert, what I see here looks for me like the alternative between sorting on server and sorting at client. Well, the work has to be done anyway for each request - letting it do at the client will relieve the server, which typically has enough work anyway...

So do the latter.