GiselleSerate / myaliases

Useful shell aliases and functions.
6 stars 1 forks source link

sanitize nickname input #47

Closed GiselleSerate closed 6 years ago

GiselleSerate commented 6 years ago

Currently I'm leaving the input checking very basic; you just can't use special characters. I think some of them are permissible in alias, though, so you should:

GiselleSerate commented 6 years ago

Strategy: stop sanitizing, it's fine. The only problem is substituting in variable names.

EDIT: It's actually not a problem. If someone wants a $ in their alias, they need to quote it.

aryarm commented 6 years ago

And alias doesn't allow $ signs in nickname, I think. "The characters /, $, `, = and any of the shell metacharacters or quoting characters listed above may not appear in an alias name." (according to the manual?) So alias 'hi$bro'='desk' won't work.

GiselleSerate commented 6 years ago

Yeah, I think the only thing that we might need to worry about are variable substitutions.