Hello!

On Mon, Jun 04, 2007 at 11:45:27PM +0200, Almir Karic wrote:
>\> This works indeed. But better use the additional quotes around $1. Just

>>get used to them, because $1 could contain IFS characters.

>true, but in this  case it doesn't really matter how shell splits words :)

Proactive security also means using safe patterns not only when you can
prove you need them, but always.

>>>i am cheating tho, and have sh symlinked to bash.

>>Why?

>i learnt to use bash, and posix sh is not good enaugh any more.

I have never missed a shell feature unless I would use awk/perl/...
anyway.

>[...]

>>I don't see any -i option documented in the sed manpage.

>-i on some seds (gsed, ssed, FBSD sed, maybe others) means ''in
>place'' edit, that feature can be reimplemented with ''sed '....' file
>>new_file; mv -g new_file file'' (it also makes sure it generates
>safe temp file, so doesn't overwrite any file accidentally). but it
>doesn't exists in OBSD sed, so his answer was 'wrong'.

It is. I'd guess it isn't in POSIX (or Single Unix) sed either, so if
you give any damn on portability, I wouldn't use it.

And then, mv doesn't know a -g flag.

Kind regards,

Hannah.

Reply via email to