Dateimanipulation

Andre Landwehr andre.landwehr at gmx.net
Tue Sep 16 14:30:32 CEST 2003


On Tue, Sep 16, 2003 at 02:13:21PM +0200, hvl at upb.de wrote:
> - --- 8< ---
> #!/bin/sh
> #
> # NOT TESTED!!!
> #
> for DATEI in /path/to/files/* ;do
>   (printf "Zeile 1\nZeile 2\n ; cat ${DATEI} ) > ${DATEI}.tmpneu
>   mv ${DATEI}.neu $DATEI
> done
> - --- >8 ---

yo, oder auch mit dem großen Totschläger (getestet):

for I in *; do perl -i -e '$/="völligunsinnigerstringdernirgendwovorkommt";print "bla\nfasel\n". <>;' $I; done

Andre

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lug-owl.de/pipermail/linux/attachments/20030916/01479e81/attachment.sig>


More information about the Linux mailing list