I've a script like this.
#!/bin/bash
echo -n /tmp/ /other_dir/ | xargs -n 1 -d\ -I % $1
What I would like to achieve is the possibility of using the delimiter "%" in the command associated to the $1 variable. For example
. myscript "ls -la %*.txt"
which should list only .txt files in each directory. I've tried also without the quotes but it doesn't work. The message I get now is that /tmp/*.txt and /other_dir/*.txt are not existent.