Bash script doesnt work

Hello, i'm trying to make a bash script which backs-up all mysql databases with their own name and todays date.
I got this so far:

Code:
#!/bin/bash

tijd=`date +%A`

/usr/local/psa/mysql/bin/mysqlshow -u admin --password=pass | grep '^|'|grep -v 
Databases | cut -f 2 -d ' ' | awk '{ print "/usr/local/psa/mysql/bin/mysqldump -u 
admin --password=pass " $1 " > " $tijd "-" $1 ".sql" }' | sh
$tijd is todays dayname.
Now it does work except that the filename wont become (ie) "Sunday-databasename.sql" but instead "databasename-databasename.sql"

I have _NO_ clue why this isnt working...i also tried:

Code:
/usr/local/psa/mysql/bin/mysqlshow -u admin --password=pass | grep '^|'|grep -v 
Databases | cut -f 2 -d ' ' | awk '{ print "/usr/local/psa/mysql/bin/mysqldump -u 
admin --password=pass " $1 " > " `date +%A` "-" $1 ".sql" }' | sh
but that doesnt work either

can anyone help me Bash script doesnt work

 

 

 

 

Top