Re: Copy entire file as one field

From: "Warren Massengill" <warrenmassengill(at)hotmail(dot)com>
To: ron(dot)l(dot)johnson(at)cox(dot)net
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Copy entire file as one field
Date: 2002-12-04 20:10:58
Message-ID: F97grKQ2CxuP5fEYq9I00003c66@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


I'm still missing something.....

Two identical files: merge and merge4; both executable by the world.
------------------------------------
$ ./merge or $ ./merge4
cannot find the file
------------------------------------
$ merge
apparently locates the file -- but cannot run it
------------------------------------
-rw------- 1 kelly kelly 3062 Dec 3 11:57 logfile
-rwxrwxrwx 1 kelly kelly 135 Dec 3 13:24 merge
-rwxrwxrwx 1 kelly kelly 135 Dec 3 10:54 merge4
drwx------ 2 kelly kelly 4096 Dec 2 04:31 pg_clog
-rw------- 1 kelly kelly 10168 Dec 2 04:31 pg_hba.conf
-rw------- 1 kelly kelly 1250 Dec 2 04:31 pg_ident.conf
-rw------- 1 kelly kelly 4 Dec 2 04:31 PG_VERSION
drwx------ 2 kelly kelly 4096 Dec 2 04:31 pg_xlog
-rw------- 1 kelly kelly 3848 Dec 2 04:31 postgresql.conf
-rw------- 1 kelly kelly 20 Dec 3 10:51 postmaster.opts
--------------------------------------
[kelly(at)localhost pg]$ ./merge
: bad interpreter: No such file or directory
[kelly(at)localhost pg]$ ./merge4
: bad interpreter: No such file or directory
--------------------------------------
[kelly(at)localhost pg]$ merge
merge: not enough arguments
merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3
merge aborted
[kelly(at)localhost pg]$
--------------------------------------

Thanks,
Warren

>
>You *must* run your script this way:
>$ ./merge4
>
>And you did make sure that the script is executable, right?
>
> > ------------------------------------
> > #!/bin/bash
> >
> > for f in `ls /home/kelly/message/*`
> > do
> > psql -d pg -c "INSERT INTO mail (message)
> > VALUES ('`cat $f`')"
> > done
> >
> > -------------------------------------
> > [kelly(at)localhost pg]$ merge
> > merge: not enough arguments
> > merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2
>file3
> > merge aborted
> > --------------------------------------
> > [kelly(at)localhost pg]$ merge4
> > bash: merge4: command not found
> > --------------------------------------
> > >
> > >On Tue, 2002-12-03 at 19:48, Warren Massengill wrote:
> > > > My database is pg, the table is mail.
> > > > The small text files are in /home/kelly/message/.
> > > > The bash shell script is merge.

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2002-12-04 20:25:04 Re: Vacuum full error No one parent tuple
Previous Message Devinder K Rajput 2002-12-04 19:10:57 Re: Copy entire file as one field