Re: How do create a user with a bashscript

Поиск
Список
Период
Сортировка
От Andreas Kretschmer
Тема Re: How do create a user with a bashscript
Дата
Msg-id 20080919085933.GA8907@tux
обсуждение исходный текст
Ответ на How do create a user with a bashscript  ("A B" <gentosaker@gmail.com>)
Ответы Re: How do create a user with a bashscript  ("A B" <gentosaker@gmail.com>)
Список pgsql-novice
A B <gentosaker@gmail.com> schrieb:

> Hi.
> I want to create a user with the  createuser  command and supply the
> password at the command line in a script, like this
>
> #!/bin/bash
> createuser  myuser
>
> but I want to supply a password on the command line, is that possible?
> The docs tells me no, but does anyone know of a workaround?

Maybe with expect(1):

NAME
       expect - programmed dialogue with interactive programs, Version 5

SYNOPSIS
       expect [ -dDinN ] [ -c cmds ] [ [ -[f|b] ] cmdfile ] [ args ]

INTRODUCTION
       Expect  is  a program that "talks" to other interactive programs according to a script.  Following the script,
Expectknows what can be expected 
       from a program and what the correct response should be.  An interpreted language provides branching and
high-levelcontrol structures to  direct 
       the dialogue.  In addition, the user can take control and interact directly when desired, afterward returning
controlto the script. 



Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

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

Предыдущее
От: "Sean Davis"
Дата:
Сообщение: Re: Moving data from one set of tables to another?
Следующее
От: "A B"
Дата:
Сообщение: Re: How do create a user with a bashscript