Closed GiselleSerate closed 6 years ago
@
, #
, ^
, *
, -
, _
, +
, ,
, .
, ?
, {
, }
, [
, ]
get saved. Permissible characters. Don't remove these.'
, "
don't get saved, but calling the alias with quotes in it preserves behavior as long as there are matching quotes within the alias. Can be handled if left in, or not.\
doesn't get saved, but if you call alias with \
the line it returns can be handled properly. Can be handled if left in, or not.!
, &
, (
, )
, =
, /
, :
, ;
, <
, >
, |
break the normal alias command, so we can call those undefined behavior. Don't worry about these characters.$
substitutes in the variable that bash thinks follows $. This is a problem.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.
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.
Yeah, I think the only thing that we might need to worry about are variable substitutions.
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: