Pardon me as I am relatively new to this.
[ -f /etc/example/txt] && echo "True" || echo "False"
I have the above code, I am trying to print out the hostname as well.
I have modified it to the following,
[ -f /etc/example/txt] && hostname = uname -n &&echo "$hostname:True" || echo "$hostname:False"
Unfortunately the above doesn't work. Is there a way to have the hostname printed out along with True or False?