I have both scripts:
#!/bin/bash
#this is scpt1.bash
echo -n "Enter name: "
read name
function $name
#!/bin/bash
#this is scpt2.bash
function() {
ARG1=$1
mysql -u <username> -e "
use <Database Name>;
insert into <Table Name> (column1) values ("$ARG1"); "
}
Enter name: magic mic
Error: 1054 (42S2): Unknown Column 'magic" in 'field list'
upon debugging..... bash -x scpt1.bash
I found out that the variable in ARG1="magic" and it is not "magic mic"
I also did function "$name" but it is also an error
is there a simple way for this?