Re: Copy entire file as one field

Поиск
Список
Период
Сортировка
От Warren Massengill
Тема Re: Copy entire file as one field
Дата
Msg-id F69An8hEAeuct8Pthhs00015a79@hotmail.com
обсуждение исходный текст
Ответ на Copy entire file as one field  ("Warren Massengill" <warrenmassengill@hotmail.com>)
Ответы Re: Copy entire file as one field  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-novice
The revised version has the same result. If I change the name of the script
(another poster suggested avoiding the reserved word 'merge') there is a
different error message.

Thanks,
Warren

------------------------------------
#!/bin/bash

for f in `ls /home/kelly/message/*`
do
        psql -d pg -c "INSERT INTO mail (message)
                                 VALUES ('`cat $f`')"
done

-------------------------------------
[kelly@localhost pg]$ merge
merge: not enough arguments
merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3
merge aborted
--------------------------------------
[kelly@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.
> >
> > Somehow I failed to translate your instructions...
> >
> > -----------------------------------------------------
> > #!/bin/bash
> >
> > for f in `ls /home/kelly/message*`
>                                ^^^^^^
>                            message/*
>
> > do
> >         psql -d pg -c "INSERT INTO mail (message)
> >                                  VALUES ('`cat $f`')"
> > done
>
>Your files are in that directory, so the wild card must be too.
>--
>Oliver Elphick                                Oliver.Elphick@lfix.co.uk


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


В списке pgsql-novice по дате отправления:

Предыдущее
От: Dmitri Touretsky
Дата:
Сообщение: Very slow performance - addition
Следующее
От: "Devinder K Rajput"
Дата:
Сообщение: Re: Copy entire file as one field