From 2bb2d28d7c85979282e180ffaf59bd02c46838f4 Mon Sep 17 00:00:00 2001 From: Troels Henriksen Date: Fri, 16 Jul 2010 17:03:20 +0200 Subject: [PATCH] Some more insitu examples. --- programs/insitu.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/programs/insitu.md b/programs/insitu.md index 0503f57..4946aa7 100644 --- a/programs/insitu.md +++ b/programs/insitu.md @@ -22,7 +22,15 @@ contain the output read from the command, followed by the rest of the original contents of _file_. The part of _file_ overwritten by the command output will be lost. -Insitu runs the command with `$SHELL -c command`, substituting +With `insitu`, the above would be written as + + insitu foo 'grep bar' + +Another handy use is to prepend something to an existing file: + + insitu foo 'echo whatever; cat' + +`Insitu` runs the command with `$SHELL -c command`, substituting `/bin/sh` for `$SHELL` if the latter is not set. Download