I have troubles with whitespaces and command substitution. I made a tiny script to show the problem:
#! /bin/bash
a="toilet -t --font='Dot Matrix' --filter metal --filter border ABC"
#a="find . -type f -name "hello world""
log_error=$($a 2>&1)
if [ $? -ne 0 ]
then
echo "$a"
echo "$log_error"
exit 1
fi
$a
- put the arguments in an array instead of a single string. See How can we run a command stored in a variable? – steeldriver Apr 08 '22 at 11:36eval
fix me problem. Thanks for the link. – tres.14159 Apr 08 '22 at 13:28eval
is definitely not the solution you should have taken from that link – jesse_b Apr 08 '22 at 16:32