sh(1): Explain why it is a bad idea to use aliases in scripts.
This commit is contained in:
parent
0a62a9caa9
commit
12dfb7a554
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216630
@ -456,9 +456,10 @@ would become
|
|||||||
Aliases provide a convenient way for naive users to
|
Aliases provide a convenient way for naive users to
|
||||||
create shorthands for commands without having to learn how
|
create shorthands for commands without having to learn how
|
||||||
to create functions with arguments.
|
to create functions with arguments.
|
||||||
They can also be
|
Using aliases in scripts is discouraged
|
||||||
used to create lexically obscure code.
|
because the command that defines them must be executed
|
||||||
This use is discouraged.
|
before the code that uses them is parsed.
|
||||||
|
This is fragile and not portable.
|
||||||
.Pp
|
.Pp
|
||||||
An alias name may be escaped in a command line, so that it is not
|
An alias name may be escaped in a command line, so that it is not
|
||||||
replaced by its alias value, by using quoting characters within or
|
replaced by its alias value, by using quoting characters within or
|
||||||
|
Loading…
Reference in New Issue
Block a user