summaryrefslogtreecommitdiffstats
path: root/bin/sh/sh.1
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2014-01-26 21:19:33 +0000
committerjilles <jilles@FreeBSD.org>2014-01-26 21:19:33 +0000
commit9b565c0250634c44a36639e518e7ca3ba7a88ebd (patch)
treeb13e00aabd499f2e76efcb8c8749c5884decc848 /bin/sh/sh.1
parent51348c881e5f79078f88a6d96345fa6b4798b378 (diff)
downloadFreeBSD-src-9b565c0250634c44a36639e518e7ca3ba7a88ebd.zip
FreeBSD-src-9b565c0250634c44a36639e518e7ca3ba7a88ebd.tar.gz
sh: Allow aliases to force alias substitution on the following word.
If an alias's value ends with a space or tab, the next word is also checked for aliases. This is a POSIX feature. It is useful with utilities like command and nohup (alias them to themselves followed by a space).
Diffstat (limited to 'bin/sh/sh.1')
-rw-r--r--bin/sh/sh.116
1 files changed, 15 insertions, 1 deletions
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index dc1716c..fb8328c 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
-.Dd January 3, 2014
+.Dd January 26, 2014
.Dt SH 1
.Os
.Sh NAME
@@ -533,6 +533,20 @@ would become
.Pp
.Dl "ls -F foobar"
.Pp
+Aliases are also recognized after an alias
+whose value ends with a space or tab.
+For example, if there is also an alias called
+.Dq Li nohup
+with the value
+.Dq Li "nohup " ,
+then the input
+.Pp
+.Dl "nohup lf foobar"
+.Pp
+would become
+.Pp
+.Dl "nohup ls -F foobar"
+.Pp
Aliases provide a convenient way for naive users to
create shorthands for commands without having to learn how
to create functions with arguments.
OpenPOWER on IntegriCloud