Date: Sat, 15 Jun 2002 01:47:17 +0900 From: "Akinori MUSHA" <knu@iDaemons.org> To: Trevor Johnson <trevor@jpj.net> Cc: Mikhail Teterin <mi+mx@aldan.algebra.com>, Pete Fritchman <petef@absolutbsd.org>, <portmgr@freebsd.org>, Maxim Sobolev <sobomax@freebsd.org>, <cvs-committers@freebsd.org>, <cvs-all@freebsd.org>, <jmallett@freebsd.org> Subject: Re: cvs commit: ports/Mk bsd.port.mk Message-ID: <86k7p16c4q.wl@archon.local.idaemons.org> In-Reply-To: <20020614113752.K11520-100000@blues.jpj.net> References: <200206141102.50292.mi%2Bmx@aldan.algebra.com> <20020614113752.K11520-100000@blues.jpj.net>
next in thread | previous in thread | raw e-mail | index | archive | help
At Fri, 14 Jun 2002 11:49:51 -0400 (EDT),
Trevor Johnson wrote:
> Mikhail Teterin wrote:
>
> > But the macro could be implemented without using the -i option --
> > mktemp(1) is with us since FreeBSD-2.2.7...
>
> That sounds like the best idea. I don't know how to write such a macro
> though. Would you mind writing it?
How about writing inplace(1) instead? It should be generally useful
because you can use any filter command such as sed(1), awk(1),
grep(1), sort(1), uniq(1), and so on with it. The name and the
sinopsis would be a matter of controversy, though.
NAME
inplace - processes a file through a filter command inplace
SYNOPSIS
[I can think of several options]
1) inplace file command [args ...] (just one file at a time)
2) inplace 'command [args ...]' files ...
3) inplace command [args ...] ';' files ...
DESCRIPTION
Invokes something similar to:
command args ... < file > temp && mv temp file
or if there is a '{}'in args:
command args ... file ... > temp && mv temp file
(Of course file modes shall be copied)
--
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
"Somewhere out of a memory.. of lighted streets on quiet nights.."
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86k7p16c4q.wl>
