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

From: ERIC Lawson - x52010 <eric(at)bioeng(dot)washington(dot)edu>
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 15:26:55
Message-ID: Pine.GSO.4.10.10009120822390.5421-100000@gandalf.bioeng.washington.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

(In tcsh; other shells have similar/equivalent syntax.)

At the shell prompt:

foreach i (*.sql)
echo $i
cp $i $i.bkp
end

I'm using echo and cp to illustrate the syntax only; your command(s) would
go in their place.

James Eric Lawson
Research Publications Editor III
National Simulation Resource

eric(at)bioeng(dot)washington(dot)edu

On Mon, 11 Sep 2000, Dan Browning wrote:

> OK, I've got a command (or two) that will remove all NOT NULL strings from a
> given file.
>
> cat filename | perl -pi -e "s/NOT NULL//g" > filename
>
> But how do I run that command on every file in a directory, successively?
>
> (In case you're wondering, I'm working on the pgsql/ directory of .sql files
> that interchange uses to build the database tables).
>
> Thanks,
>
> Dan Browning
> Network & Database Administrator
> Cyclone Computer Systems
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Dan Browning 2000-09-12 23:04:53 Per-user process limit: ulimit -u unlimited, how to set it for certain users
Previous Message Oliver Elphick 2000-09-12 13:58:20 Re: Don't know where to begin