🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #8056

Re: script php

#8056
From: catactttc
Date: Sun, 12 Jan 2003 13:20
45 lines
2168 bytes
In article <avrmdu$i8d5c$1@ID-101278.news.dfncis.de>, kurtsik wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Salu2.
> Bueno, la cuestion es que quiero hacer un script para automatizar la 
> creacion de usuarios (y sus privilegios) para mysql y lo mas facil me ha 
> parecido hacerlo en php, y ahi surge mi duda :-( que no he conseguido 
> aclarar:
>

mas facil seria en bash...

> Se puede hacer un script de php?(quiero decir que funcione como uno de 
> shell, no embebido en html)
>
si 

>         -Si es asi, como se le indica a la shell que el interprete de coman
> dos es php?
>
-----script--------
#!/usr/bin/php -q
<? 
$saludo="hola mundo";
echo "$saludo";
?>
-----fin del script----
la -q es para que no imprima la cabecera HTTP.

> Si no es posible he pensado que la alternatiba podria ser un script de bash 
> pero con otra duda:
>         -como se le indica a la shell que el comando que se introduce l
> o deve ejecutar mysql?
>
dos ejemplos:

$ echo "comando" | mysql dbname

o 

$ mysql dbname < lista_de_comandos.txt

> Bueno, y creo que eso es todo.
> Gracias mil :-)
Technical Details
Message-ID: <slrnb22r02.39.catactttc@paleo.chiti.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.nacamar.de!easynet-melon!easynet.net!news.rediris.es!news.uv.es!not-for-mail
References: <avrmdu$i8d5c$1@ID-101278.news.dfncis.de>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII-7-bit
X-Google-Thread: f86c8,741c2d5d0a89219b
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-01-12 05:28:02 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!feed.news.nacamar.de!easynet-melon!easynet.net!news.rediris.es!news.uv.es!not-for-mail
From: catactttc <catactttc@nospam.aqui.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: script php
Date: Sun, 12 Jan 2003 13:20:13 +0000 (UTC)
Organization: Universitat de Valencia
Lines: 45
Distribution: es
Message-ID: <slrnb22r02.39.catactttc@paleo.chiti.org>
References: <avrmdu$i8d5c$1@ID-101278.news.dfncis.de>
NNTP-Posting-Host: 212-170-183-24.uc.nombres.ttd.es
X-Trace: peque.uv.es 1042377613 4408 212.170.183.24 (12 Jan 2003 13:20:13 GMT)
X-Complaints-To: newsmanager@uv.es
NNTP-Posting-Date: Sun, 12 Jan 2003 13:20:13 +0000 (UTC)
User-Agent: slrn/0.9.7.4 (Linux)