Обсуждение: Script to createuser

Поиск
Список
Период
Сортировка

Script to createuser

От
Rebecca.R.Hepper@seagate.com
Дата:
Hello All,

I am running Redhat 7.0.

I am trying to create a script that will add a user.  My script looks like
this:

echo 'createuser becky -d -a' | su postgres

When I run my script, I receive the following message even though the user
is created.

bash: /home/username/. bashrc:  Permission denied
CREATE USER

Why do I get this error and is there a way to get rid of it?

Thanks for the help!!
Rebecca





Re: Script to createuser

От
Stefan Huber
Дата:
>echo 'createuser becky -d -a' | su postgres


maybe you'd like it the otherway round? ;)

$ su - postgres -c "createuser becky -d -a"

Stefan

--
"On the Internet, there is no 'they'. There's only a very,
very large 'us'." --- Douglas Adams


Re: Script to createuser

От
Peter Eisentraut
Дата:
Rebecca.R.Hepper@seagate.com writes:

> echo 'createuser becky -d -a' | su postgres

Try

createuser -U postgres -d -a becky

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter