Timeline for hat ^ symbol in grep argument
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 24, 2016 at 12:00 | comment | added | Kalavan | @a.smith, if you only added checking of error code of grep, then it didn't solve a bug Muzer was talking about. You won't be able to add user 'rich', when you have a user 'richard'. Regexp is too wide here. Think about using "^$username:" - colon is used to separate fields in /etc/passwd, so it would match whole field as a username. | |
| Nov 24, 2016 at 10:39 | comment | added | a.smith | Thanks @Muzer the following has removed the potential bug: if [ $? -eq 0 ]; then echo "$username exists!" exit 1 | |
| Nov 24, 2016 at 10:37 | vote | accept | a.smith | ||
| Nov 24, 2016 at 10:32 | history | answered | Muzer | CC BY-SA 3.0 |