Q:

concatenate a function with string and execute it

I wanna concatenate a command specified in a function with string and execute it after.
  I will simplify my need with an exemple to execute "ls -l -a"

#!/bin/bash

echo -e "specify command"
read command                                 # ls

echo -e "specify argument"
read arg                                     # -l

test () {
$command $arg
}

eval 'test -a'

Except that 

A:

Use an array, like this:
args=()

read -r command
args+=( "$command" )

read -r arg
args+=( "$arg" )

"${args[@]}" -a

If you want a function, then you could do this:
run_with_extra_switch () {
    "$@" -a
}

run_with_extra_switch "${args[@]}"

