Например, есть тестовый скрипт:
#!/bin/bash
var1="cat $0"
var2=$($var1)
echo "${var2}"
#!/bin/bash
var1="cat $0 | grep bash"
var2=$($var1)
echo "${var2}"
$ ./pipe.sh
cat: |: No such file or directory
cat: grep: No such file or directory
cat: bash: No such file or directory
#!/bin/bash
var1="cat $0 | grep bash"
var2=$($var1)
echo "${var2}"