About bash script. I can't understand this script. Could you please help me understand this script?
su - fred <<! >/dev/null 2>&1
# su: invoke process by substitute user
# fred: username
- Robert JLv 71 month ago
The <<! inputs a "!" to the program as an option; that inverts the success/fail result status from the program.
The rest of the line makes it "silent", with nothing displayed.
> is redirect, the standard output is redirected to a file or device.
/dev/null is a standardised "fake device" that ignores anything sent to it.
2>&1 redirects the standard error output (stream 2) to the same destination as the standard output (stream 1), eg. to /dev/null