Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

shell variable parsing in a file?



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@xxxxxxxxxxxxxx, but that bounced.

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



Messages sorted by: Reverse Date, Date, Thread, Author