summaryrefslogtreecommitdiffstats
path: root/misc-utils
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:53 +0100
committerKarel Zak2006-12-07 00:25:53 +0100
commitffc4374869b9ac10539a3c18e13b29d1b0c64484 (patch)
tree1b8054e83f7f70e8fa77499fc9246d1cc16faa15 /misc-utils
parentImported from util-linux-2.11n tarball. (diff)
downloadkernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.gz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.tar.xz
kernel-qcow2-util-linux-ffc4374869b9ac10539a3c18e13b29d1b0c64484.zip
Imported from util-linux-2.11o tarball.
Diffstat (limited to 'misc-utils')
-rw-r--r--misc-utils/Makefile12
-rw-r--r--misc-utils/cal.119
-rw-r--r--misc-utils/cal.c9
-rw-r--r--misc-utils/logger.c2
-rw-r--r--misc-utils/look.c2
-rw-r--r--misc-utils/mcookie.c2
-rw-r--r--misc-utils/namei.c2
-rw-r--r--misc-utils/replay.15
-rwxr-xr-xmisc-utils/replay.pl6
-rw-r--r--misc-utils/script.13
-rw-r--r--misc-utils/script.c10
-rw-r--r--misc-utils/setterm.c3
12 files changed, 49 insertions, 26 deletions
diff --git a/misc-utils/Makefile b/misc-utils/Makefile
index 67350b709..d61add412 100644
--- a/misc-utils/Makefile
+++ b/misc-utils/Makefile
@@ -11,14 +11,13 @@ include ../MCONFIG
# Where to put man pages?
-MAN1= cal.1 chkdupexe.1 ddate.1 kill.1 \
- logger.1 look.1 mcookie.1 namei.1 rename.1 script.1 \
- whereis.1
+MAN1= cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
+ namei.1 rename.1 script.1 whereis.1
# Where to put binaries?
# See the "install" rule for the links. . .
-BIN= kill
+BIN=
USRBIN= cal chkdupexe ddate logger look mcookie \
namei rename script whereis
@@ -35,6 +34,11 @@ USRBIN:=$(USRBIN) write
MAN1:=$(MAN1) write.1
endif
+ifeq "$(HAVE_KILL)" "no"
+BIN:=$(BIN) kill
+MAN1:=$(MAN1) kill.1
+endif
+
ifeq "$(HAVE_NCURSES)" "yes"
USRBIN:=$(USRBIN) setterm
MAN1:=$(MAN1) setterm.1
diff --git a/misc-utils/cal.1 b/misc-utils/cal.1
index d16d30500..7d5e71eb1 100644
--- a/misc-utils/cal.1
+++ b/misc-utils/cal.1
@@ -42,7 +42,7 @@
.Nd displays a calendar
.Sh SYNOPSIS
.Nm cal
-.Op Fl mjy13
+.Op Fl smjy13
.Op [ Ar month ] Ar year
.Sh DESCRIPTION
.Nm Cal
@@ -52,14 +52,15 @@ the current month is displayed.
The options are as follows:
.Bl -tag -width Ds
.It Fl 1
-Display single month output (use if cal was built with -3 as default to get
-older traditional output)
+Display single month output.
+(This is the default.)
.It Fl 3
-Display prev/current/next month output (use if cal was built with traditional
--1 as default to get newer improved output)
+Display prev/current/next month output.
+.It Fl s
+Display Sunday as the first day of the week.
+(This is the default.)
.It Fl m
Display Monday as the first day of the week.
-(The default is Sunday.)
.It Fl j
Display Julian dates (days one-based, numbered from January 1).
.It Fl y
@@ -88,3 +89,9 @@ calendar for that month is a bit unusual.
A
.Nm
command appeared in Version 6 AT&T UNIX.
+.Sh OTHER VERSIONS
+Several much more elaborate versions of this program exist,
+with support for colors, holidays, birthdays, reminders and
+appointments, etc. For example, try the cal from
+http://home.sprynet.com/~cbagwell/projects.html
+or GNU gcal.
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 37aa1b1de..b71a72e8e 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -222,14 +222,17 @@ main(int argc, char **argv) {
#endif
yflag = 0;
- while ((ch = getopt(argc, argv, "13mjyV")) != EOF)
+ while ((ch = getopt(argc, argv, "13mjyV")) != -1)
switch(ch) {
case '1':
- num_months = 1;
+ num_months = 1; /* default */
break;
case '3':
num_months = 3;
break;
+ case 's':
+ week1stday = 0; /* default */
+ break;
case 'm':
week1stday = 1;
break;
@@ -668,6 +671,6 @@ void
usage()
{
- (void)fprintf(stderr, _("usage: cal [-mjyV] [[month] year]\n"));
+ (void)fprintf(stderr, _("usage: cal [-13smjyV] [[month] year]\n"));
exit(1);
}
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index e00578735..8f28e39ec 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -132,7 +132,7 @@ main(int argc, char **argv) {
tag = NULL;
pri = LOG_NOTICE;
logflags = 0;
- while ((ch = getopt(argc, argv, "f:ip:st:u:d")) != EOF)
+ while ((ch = getopt(argc, argv, "f:ip:st:u:d")) != -1)
switch((char)ch) {
case 'f': /* file to log */
if (freopen(optarg, "r", stdin) == NULL) {
diff --git a/misc-utils/look.c b/misc-utils/look.c
index f3b4ba517..7ba4ac06d 100644
--- a/misc-utils/look.c
+++ b/misc-utils/look.c
@@ -98,7 +98,7 @@ main(int argc, char *argv[])
termchar = '\0';
string = NULL; /* just for gcc */
- while ((ch = getopt(argc, argv, "adft:")) != EOF)
+ while ((ch = getopt(argc, argv, "adft:")) != -1)
switch(ch) {
case 'a':
file = _PATH_WORDS_ALT;
diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c
index 6930745b2..e550bec6a 100644
--- a/misc-utils/mcookie.c
+++ b/misc-utils/mcookie.c
@@ -90,7 +90,7 @@ int main( int argc, char **argv )
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- while ((c = getopt( argc, argv, "vf:" )) != EOF)
+ while ((c = getopt( argc, argv, "vf:" )) != -1)
switch (c) {
case 'v': ++Verbose; break;
case 'f': file = optarg; break;
diff --git a/misc-utils/namei.c b/misc-utils/namei.c
index 60ec98a93..ffdb73599 100644
--- a/misc-utils/namei.c
+++ b/misc-utils/namei.c
@@ -81,7 +81,7 @@ main(int argc, char **argv) {
if(argc < 2)
usage();
- while((c = getopt(argc, argv, "mx")) != EOF){
+ while((c = getopt(argc, argv, "mx")) != -1){
switch(c){
case 'm':
mflag = !mflag;
diff --git a/misc-utils/replay.1 b/misc-utils/replay.1
index 578cadbc5..52d82c250 100644
--- a/misc-utils/replay.1
+++ b/misc-utils/replay.1
@@ -149,7 +149,7 @@ replay timingfile [typescript [divisor]]
.IX Header "DESCRIPTION"
This program replays a typescript, using timing information to ensure that
output happens at the same speed as it originally appeared when the script
-was recorded. It is only guaranteed to work preperly if run on the same
+was recorded. It is only guaranteed to work properly if run on the same
terminal the script was recorded on.
.PP
The timings information is what script outputs to standard error if it is
@@ -171,6 +171,9 @@ specifying a divisor of 2 makes the script be replayed twice as fast.
\& Script done, file is typescript
\& % replay timingfile
.Ve
+.SH "SEE ALSO"
+.IX Header "SEE ALSO"
+.BR script (1)
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
This program is in the public domain.
diff --git a/misc-utils/replay.pl b/misc-utils/replay.pl
index 78564d6be..416dc6019 100755
--- a/misc-utils/replay.pl
+++ b/misc-utils/replay.pl
@@ -16,7 +16,7 @@ replay timingfile [typescript [divisor]]
This program replays a typescript, using timing information to ensure that
output happens at the same speed as it originally appeared when the script
-was recorded. It is only guaranteed to work preperly if run on the same
+was recorded. It is only guaranteed to work properly if run on the same
terminal the script was recorded on.
The timings information is what script outputs to standard error if it is
@@ -69,6 +69,10 @@ while (<TIMING>) {
}
print $oldblock;
+=head1 SEE ALSO
+
+script(1)
+
=head1 COPYRIGHT
This program is in the public domain.
diff --git a/misc-utils/script.1 b/misc-utils/script.1
index 545ac3bc6..6e987732e 100644
--- a/misc-utils/script.1
+++ b/misc-utils/script.1
@@ -124,7 +124,8 @@ is assumed. (Most shells set this variable automatically).
.Xr csh 1
(for the
.Em history
-mechanism).
+mechanism),
+.Xr replay 1 .
.Sh HISTORY
The
.Nm script
diff --git a/misc-utils/script.c b/misc-utils/script.c
index 973e80aa6..a5d0c6637 100644
--- a/misc-utils/script.c
+++ b/misc-utils/script.c
@@ -98,12 +98,12 @@ int tflg = 0;
static char *progname;
static void
-die_if_symlink(char *fn) {
+die_if_link(char *fn) {
struct stat s;
- if (lstat(fn, &s) == 0 && S_ISLNK(s.st_mode)) {
+ if (lstat(fn, &s) == 0 && (S_ISLNK(s.st_mode) || s.st_nlink > 1)) {
fprintf(stderr,
- _("Warning: `%s' is a symlink.\n"
+ _("Warning: `%s' is a link.\n"
"Use `%s [options] %s' if you really "
"want to use it.\n"
"Script not started.\n"),
@@ -135,7 +135,7 @@ main(int argc, char **argv) {
}
}
- while ((ch = getopt(argc, argv, "afqt")) != EOF)
+ while ((ch = getopt(argc, argv, "afqt")) != -1)
switch((char)ch) {
case 'a':
aflg++;
@@ -162,7 +162,7 @@ main(int argc, char **argv) {
fname = argv[0];
else {
fname = "typescript";
- die_if_symlink(fname);
+ die_if_link(fname);
}
if ((fscript = fopen(fname, aflg ? "a" : "w")) == NULL) {
perror(fname);
diff --git a/misc-utils/setterm.c b/misc-utils/setterm.c
index 435e7e482..24fb90d83 100644
--- a/misc-utils/setterm.c
+++ b/misc-utils/setterm.c
@@ -802,7 +802,8 @@ static char *ti_entry(const char *name) {
char *buf_ptr;
- if ((buf_ptr = tigetstr(name)) == (char *)-1) buf_ptr = NULL;
+ if ((buf_ptr = tigetstr((char *)name)) == (char *)-1)
+ buf_ptr = NULL;
return buf_ptr;
}