I have done a script on a machine with this command on it
printf -v $1 %s $2
It's working fine on the server that I am using. But when I copied the scripts to another server, I get this error. What am I missing here?
EDIT: What the code does to my script is it declares variables, but is not localized on a function. Here's the complete function
#Declare each property=value as regular bash variable=value
function getProperty {
for x in $(echo ${1} | tr ":" "\n")
do
set -- $(echo ${x} | tr "=" "\n")
printf -v $1 %s $2
#I tried using declare, but the variables become localized to this function only
done
}