| Summary: | sysctl manpage: add example for tcsh | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Documentation | Reporter: | Slaven Rezic <eserte> | ||||
| Component: | Books & Articles | Assignee: | freebsd-doc (Nobody) <doc> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | Latest | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Slaven Rezic
2002-10-24 15:30:01 UTC
The suggested command doesn't work on the tcsh prompt for me, but it
does work if put it in my .tcshrc file. Do you mind if I commit a
slightly different patch than the one in the PR? One that explicitly
mentions .tcshrc like below:
%%%
Index: sysctl.8
===================================================================
RCS file: /home/ncvs/src/sbin/sysctl/sysctl.8,v
retrieving revision 1.47
diff -u -r1.47 sysctl.8
--- sysctl.8 6 Jul 2002 19:35:04 -0000 1.47
+++ sysctl.8 21 Nov 2002 02:15:07 -0000
@@ -95,6 +95,15 @@
listsysctls () { set -A reply $(sysctl -AN ${1%.*}) }
compctl -K listsysctls sysctl
.Ed
+.Pp
+or if you are using
+.Nm tcsh
+as your shell, add the following to your
+.Pa .tcshrc
+file:
+.Bd -literal -offset indent
+complete sysctl 'n/*/`sysctl -Na`/'
+.Ed
.It Fl n
Show only variable values, not their names.
This option is useful for setting shell variables.
%%%
Giorgos Keramidas <keramida@freebsd.org> writes: > The suggested command doesn't work on the tcsh prompt for me, but it > does work if put it in my .tcshrc file. Strange, the example works for me in the command line. > Do you mind if I commit a > slightly different patch than the one in the PR? One that explicitly > mentions .tcshrc like below: That's OK with me --- putting it into .tcshrc will be the common case. Regards, Slaven > %%% > Index: sysctl.8 > =================================================================== > RCS file: /home/ncvs/src/sbin/sysctl/sysctl.8,v > retrieving revision 1.47 > diff -u -r1.47 sysctl.8 > --- sysctl.8 6 Jul 2002 19:35:04 -0000 1.47 > +++ sysctl.8 21 Nov 2002 02:15:07 -0000 > @@ -95,6 +95,15 @@ > listsysctls () { set -A reply $(sysctl -AN ${1%.*}) } > compctl -K listsysctls sysctl > .Ed > +.Pp > +or if you are using > +.Nm tcsh > +as your shell, add the following to your > +.Pa .tcshrc > +file: > +.Bd -literal -offset indent > +complete sysctl 'n/*/`sysctl -Na`/' > +.Ed > .It Fl n > Show only variable values, not their names. > This option is useful for setting shell variables. > %%% > -- Slaven Rezic - slaven.rezic@berlin.de tkrevdiff - graphical display of diffs between revisions (RCS or CVS) http://ptktools.sourceforge.net/#tkrevdiff On 2002-11-21 01:40, Slaven Rezic <slaven.rezic@berlin.de> wrote: >Slaven Rezic <slaven.rezic@berlin.de> wrote: >>Giorgos Keramidas <keramida@freebsd.org> writes: >>> The suggested command doesn't work on the tcsh prompt for me, but it >>> does work if put it in my .tcshrc file. >> >>Strange, the example works for me in the command line. Pilot error. I moved my .tcshrc and .cshrc out of the way and it works for me too. Your diff looks fine, sorry 'bout the confusion :/ In the name of close a doc PR.
I think this seems like a very good idea to add. I didn't know about
the feature but this code is certainly going to my .tcshrc now.
I would suggest to reference tcsh(1) with Xr instead of using ".Nm
tcsh" like :
%%%
--- sbin/sysctl/sysctl.8.orig Thu Oct 24 16:09:29 2002
+++ sbin/sysctl/sysctl.8 Thu Oct 24 16:11:22 2002
@@ -93,6 +93,13 @@
listsysctls () { set -A reply $(sysctl -AN ${1%.*}) }
compctl -K listsysctls sysctl
.Ed
+.Pp
+or in
+.Xr tcsh 1 ,
+the following code:
+.Bd -literal -offset indent
+complete sysctl 'n/*/`sysctl -Na`/'
+.Ed
.It Fl n
Show only variable values, not their names.
This option is useful for setting shell variables.
%%%
Just my 0.02c.
--
Simon L. Nielsen
With no PGP since GNATS don't like mime patches.
State Changed From-To: open->closed A variation of the original patch was committed by few moments ago. Thank you! |