Hi
I need to give a variable to a mysql script from a bash shell script.
It is a date where the time is hardcoded in the script.
The Shell script
Paping the sql script into the connect string is a must, any other suggestions on how to do it is mutch appriciatede
The Sql script
The example dosn't work - and I tryede several other ways.
The only thing i need is to use the the_date variable in the sql script that I define in the shell.
Hope someone can help.
/Lhg
I need to give a variable to a mysql script from a bash shell script.
It is a date where the time is hardcoded in the script.
The Shell script
Code:
#!/bin/bash
#
####################################################
# Script by Lars Grynderup #
echo "This script is used to insert a standart Weekday"
echo
[b]the_date=2007-03-30 [/b]
mysql -h localhost -u itdrift -pitdrift < weekday.sql
Paping the sql script into the connect string is a must, any other suggestions on how to do it is mutch appriciatede
The Sql script
Code:
use ah;
insert into test_table
values ("",
"Test of dates",
",
"0",
"",
date "[b]$the_date[/b] 06:00:00",
date "[b]$the_date[/b] 07:15:00"
);
The example dosn't work - and I tryede several other ways.
The only thing i need is to use the the_date variable in the sql script that I define in the shell.
Hope someone can help.
/Lhg