I need to triggeer a bash passing parameter with a format [ variable_name="value" ] like this:
./test.sh ip='22.214.171.124' hostname='whatever' pwd='/test' ftpcmd='CWD debug' user='stefano'
On test.sh script I want to assign to any variable the relevant value:
#!/bin/bash eval `echo "$@"` echo $ftpcmd
But I get a
prova: command not found error.
I cannot understand what's wrong on my
ftpcmd='CWD debug' parameter neither how I should write it instead.
If I try to replace eval with declare then the
$ftpcmd is set only to
CWD instead of
CWD debug as I'm expecting.