Você teria que preencher a variável $target em seu script, como por exemplo target=$1 . Simplesmente substituí-lo não será suficiente e não funcionará.
Vamos ver o que podemos encontrar na documentação sobre isso:
Arguments passed to the script from the command line [1] :
$0, $1, $2, $3 ...
$0is the name of the script itself,$1is the first argument,$2the second,$3the third, and so forth. [2] After$9, the arguments must be enclosed in brackets, for example,${10}, ${11}, ${12}.The special variables
$*and$@denote all the positional parameters.
O que você pode fazer, no entanto, é algo semelhante a isso para torná-lo mais legível dentro do script:
#!/bin/sh
target=$1
Mas isso significaria aninhamento de variáveis / dados que é codificado pela maioria das pessoas como uma prática ruim.