I want to optimize a bash code using 1 line instead of two this is the lines i want to optimize:
grep -E "$name" /etc/passwd
if [ $? -eq 0 ]
#...
so the if will test the exit of the last command (grep), i want to merge "grep -E "$name" /etc/passwd" in the if statement to have something like:
if [ ##### -eq 0 ]
thanks for your help :)