I need to run the following command with sudo (technically just the dd part of this command needs sudo):
xz -d -c -v nvme0n1.dd.xz | xdelta3 -e -9 < (dd if=/dev/nvme0n1 bs=1GB) nvme0n1.dd.xdelta
Usually when I need to run something like this with multiple pipes as sudo I simply pass it as a string to:
sudo bash -c "command"
But when I do that with this command I get the following error:
bash: Syntax error near unexpected token (
I tried escaping the brackets but when I do that I get:
bash: (dd no such file or directory
What's the best approach to run this command as sudo?
<and(in a bash process substitution - regardless of the use ofsudoBashcapitalized rather thanbash. This tells me you have modified the error messages. Please don't do that. We need to trust that what you show is exactly what you see.