I have a command:
dwebp /home/user/1/input.webp -o /home/user/2/output.png
What should I add to execute this command only if input.webp
exists?
I have a command:
dwebp /home/user/1/input.webp -o /home/user/2/output.png
What should I add to execute this command only if input.webp
exists?
You can create a script that validates that, and executes the command only if that file exists in the filesystem.
#!/usr/bin/bash
if [ -f /home/user/1/input.webp ]; then
dwebp /home/user/1/input.webp -o /home/user/2/output.png
fi