+ # need to use printf: different shells have inconsistent
+ # rules re handling of "\n" in their params,
+ # and ${insert} definitely contains "\n"
+ printf "%s\n" "${header}"
Not sure that would work the way you expect it to. Consider this example:
,----
| #!/bin/dash
|
| set -e
| set -u
| #set -x
|
| insert="foo\n"
|
| printf "1. insert='%s'\n" "$insert"
| printf "2. insert='$insert'\n"
`----
The output of that on my box is:
1. insert='foo\n'
2. insert='foo
'
That is, the expected newline after fooin (1), isn't.
And you don't really want to do it like in (2), do you?
Cheers,
--
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox