By using your shell's variable substitution, I'm afraid. export outfile='/path/to/file' mysql -e "select blah into outfile '$outfile'"
You'll have to build a shell script or something that generates your filename, and then do an interactive call. Maybe you could write a stored procedure that generates a query string and then executes it, too - I've little to no experience with SPs in MySQL. -- Bier met grenadyn Is als mosterd by den wyn Sy die't drinkt, is eene kwezel Hy die't drinkt, is ras een ezel -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql