zsh-workers
 help / color / mirror / code / Atom feed
* shell variable parsing in a file?
@ 1999-02-16 22:13 Jason Price
  1999-02-17  4:06 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Price @ 1999-02-16 22:13 UTC (permalink / raw)
  To: zsh-workers

I guess...

What I'd like to do is create a file like so:

user.$USER.group.$GROUP

and several such lines.  Some just strait text, some with shell variables
interspersed.

I thought that:

echo "`cat datafile`"

would do the interpretation, but it didn't.  

Is there a way that I can do this?

What I'm trying to do is set up a script that will querry for group name,
and some other data, and then set up some tables for them to use under
mySQL.  If there is an easier way to do this, let me know, as a DBA, I am
not.  (groups would come in and out, and this would set up the base set of
tables.  We're coding up a nicer UI for them to modify and extend the
tables, but the base creation would be done at the begining of the term by
some administrator.)

Thanks;
Jason

(PS: I tried to send this to zsh-users@sunsite.auc.dk, but that bounced.
I'm probably braindead though and forgot what the real address was/is)

-- 
"Do not confuse Repentance with Disgust: for one comes from the Landlord,
and the other is from the Enemy." --C.S. Lewis _The_Pilgrim's_Regress_
Jason Price	jprice@gatech.edu
Christian, Catholic, Sysadmin, Linux installer, Theta Xi, Atlanta-TEC.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* shell variable parsing in a file?
  1999-02-16 22:13 shell variable parsing in a file? Jason Price
@ 1999-02-17  4:06 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1999-02-17  4:06 UTC (permalink / raw)
  To: Jason Price; +Cc: zsh-workers

Jason Price writes:
 > What I'd like to do is create a file like so:
 > 
 > user.$USER.group.$GROUP
 > 
 > echo "`cat datafile`"
 > 
 > Is there a way that I can do this?

This will work:

zsh% eval "cat <<EOF
dquote> $(<datafile)
dquote> EOF"

 > What I'm trying to do is set up a script that will querry for group name,
 > and some other data, and then set up some tables for them to use under
 > mySQL.  If there is an easier way to do this, let me know, as a DBA, I am
 > not. 

There's a perl DBD driver so that you can use the DBI package to send
commands to mySQL.  You could write a perl program that interpolates
the necessary variables and creates the schema.

 > (PS: I tried to send this to zsh-users@sunsite.auc.dk, but that bounced.

It should have worked ... what was the reason given for the bounce, in
the returned message?


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-02-17  4:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-16 22:13 shell variable parsing in a file? Jason Price
1999-02-17  4:06 ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).