I have an executable script hello containing the following code,
#!/bin/bash
echo "hello" > /dev/tty
I want to redirect it's output to /dev/null.
./hello > /dev/null 2>&1
doesn't work, because it redirects only stdout and stderr.
I found two answers, claiming that this can be done using script command, but they doesn't explain how.
https://unix.stackexchange.com/a/297237/421466
https://unix.stackexchange.com/a/296108/421466
Or is there any other way to suppress its output?
mountcommand directly. Doing so renderedsudocommand useless and I couldn'tumount /dev/ttybecause it required sudo privilage. Thankfully I was experimenting on a virtual machine :). – Akash Karnatak Jul 07 '20 at 14:36