aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-07-25 10:57:39 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-07-25 10:57:39 +0000
commit7e1975c2b2dd30b820230782ad456dd5772918f5 (patch)
tree133c1df05e4ec1eddcc3640d2f65f9eef939e399 /bin
parent050f7913c922aa55769d4c919179df8fded3e4eb (diff)
Notes
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/cd.c4
-rw-r--r--bin/sh/options.h4
-rw-r--r--bin/sh/sh.113
3 files changed, 17 insertions, 4 deletions
diff --git a/bin/sh/cd.c b/bin/sh/cd.c
index cf46a02642b8..aa1fd5ab5a1b 100644
--- a/bin/sh/cd.c
+++ b/bin/sh/cd.c
@@ -88,7 +88,7 @@ cdcmd(int argc, char **argv)
int ch, phys, print = 0;
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
- phys = 0;
+ phys = Pflag;
while ((ch = getopt(argc, argv, "LP")) != -1) {
switch (ch) {
case 'L':
@@ -324,7 +324,7 @@ pwdcmd(int argc, char **argv)
int ch, phys;
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
- phys = 0;
+ phys = Pflag;
while ((ch = getopt(argc, argv, "LP")) != -1) {
switch (ch) {
case 'L':
diff --git a/bin/sh/options.h b/bin/sh/options.h
index 016a9369c716..5aec64e245d9 100644
--- a/bin/sh/options.h
+++ b/bin/sh/options.h
@@ -65,8 +65,9 @@ struct shparam {
#define uflag optlist[14].val
#define privileged optlist[15].val
#define Tflag optlist[16].val
+#define Pflag optlist[17].val
-#define NOPTS 17
+#define NOPTS 18
struct optent {
const char *name;
@@ -93,6 +94,7 @@ struct optent optlist[NOPTS] = {
{ "nounset", 'u', 0 },
{ "privileged", 'p', 0 },
{ "trapsasync", 'T', 0 },
+ { "physical", 'P', 0 },
};
#else
extern struct optent optlist[NOPTS];
diff --git a/bin/sh/sh.1 b/bin/sh/sh.1
index 38410d091ad1..0bfd9b6b7ddf 100644
--- a/bin/sh/sh.1
+++ b/bin/sh/sh.1
@@ -43,7 +43,7 @@
.Nd command interpreter (shell)
.Sh SYNOPSIS
.Nm
-.Op Fl /+abCEefIimnpsTuVvx
+.Op Fl /+abCEefIimnPpsTuVvx
.Op Fl /+o Ar longname
.Op Fl c Ar string
.Op Ar arg ...
@@ -225,6 +225,17 @@ Turn on job control (set automatically when interactive).
If not interactive, read commands but do not
execute them. This is useful for checking the
syntax of shell scripts.
+.It Fl P Li physical
+Change the default for the
+.Ic cd
+and
+.Ic pwd
+commands from
+.Fl L
+(logical directory layout)
+to
+.Fl P
+(physical directory layout).
.It Fl p Li privileged
Turn on privileged mode. This mode is enabled on startup
if either the effective user or group id is not equal to the