2 ms·
I am very proficient in Bash. My day job is as a Senior DevOps engineer. If I were doing an interview and was asked that question, I would never give the answer
by mmh0000 3y ago
I am very proficient in Bash. My day job is as a Senior DevOps engineer. If I were doing an interview and was asked that question, I would never give the answer `${1:?}` (if I even remember at the time that it existed) because it is terrible code. It is obscure and unreadable.
The goal of a DevOps engineer should be to write maintainable code so that a junior can come in and tell what it does immediately.
As another commenter said, my answer would be: `[[ $# -ne 1 ]] && exit 1`. That's readable and understandable to anyone who has a basic understanding of bash scripting.