1 2 3 4 5 6 7
#!/bin/bash set -e echo "${1:-}" | sudo -u "${2:-root}" --stdin id -u > "${3:-stdout}" 2> "${4:-stderr}"