Re: Removing all instances of "NOT NULL" from an entire directory of files

From: Jesus Aneiros <aneiros(at)jagua(dot)cfg(dot)sld(dot)cu>
To: Dan Browning <danb(at)cyclonecomputers(dot)com>
Cc: redhat-list(at)redhat(dot)com, pgsql-novice(at)postgresql(dot)org, interchange-users(at)minivend(dot)com
Subject: Re: Removing all instances of "NOT NULL" from an entire directory of files
Date: 2000-09-12 02:08:59
Message-ID: Pine.LNX.4.10.10009112202270.8252-100000@jagua.cfg.sld.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, 11 Sep 2000, Dan Browning wrote:

> cat filename | perl -pi -e "s/NOT NULL//g" > filename
>
> But how do I run that command on every file in a directory, successively?

perl -i -pe 's/NOT NULL//g' *

The -i is doing the replacement in place so the pipe and redirection are
not necesary unless you want to keep the orginals, then you could use
-ibak

--
Jesus Aneiros Sosa
mailto:aneiros(at)jagua(dot)cfg(dot)sld(dot)cu
http://jagua.cfg.sld.cu/~aneiros

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Cannata 2000-09-12 02:16:50 Don't know where to begin
Previous Message Claus Houmøller 2000-09-12 00:30:01 Re: inserting a file into a database.