Hi,

I was wondering why -s didn't work after upgrading to buster, and
remembered that was a patch I had made myself.

Unfortunately it seems not to have been integrated yet. Here is the
patch updated for 3.1.23.

Please add it. Maybe forward upstream?

Paul
diff -ru at-3.1.23.orig/at.1.in at-3.1.23/at.1.in
--- at-3.1.23.orig/at.1.in.orig 2018-07-24 14:41:23.000000000 +0200
+++ at-3.1.23.orig/at.1.in      2020-07-26 14:08:33.796355635 +0200
@@ -8,7 +8,7 @@
 .IR queue ]
 .RB [ \-f
 .IR file ]
-.RB [ \-mMlv ]
+.RB [ \-mMlvs ]
 .IR timespec " ...\&"
 .br
 .B at
@@ -17,7 +17,7 @@
 .IR queue ]
 .RB [ \-f
 .IR file ]
-.RB [ \-mMkv ]
+.RB [ \-mMkvs ]
 .RB [ \-t
 .IR time ]
 .br
@@ -257,6 +257,9 @@
 .P
 Times displayed will be in the format "Thu Feb 20 14:50:00 1997".
 .TP
++.B \-s
++Be silent; don't output "job xx at xxx" or "warning: commands will be 
executed using /bin/sh" messages when jobs are created.
++.TP
 .B
 \-c
 cats the jobs listed on the command line to standard output.
diff -ru at-3.1.23.orig/at.c at-3.1.23/at.c
--- at-3.1.23.orig/at.c 2018-07-24 14:41:23.000000000 +0200
+++ at-3.1.23/at.c      2020-07-26 14:12:09.951471012 +0200
@@ -116,6 +116,7 @@
     "TERM", "DISPLAY", "_", "SHELLOPTS", "BASH_VERSINFO", "EUID", "GROUPS", 
"PPID", "UID"
 };
 static int send_mail = 0;
+static int silent = 0;
 
 /* External variables */
 
@@ -512,10 +513,12 @@
 
     close(fd2);
 
-    runtime = localtime(&runtimer);
+    if (!silent) {
+       runtime = localtime(&runtimer);
 
-    strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
-    fprintf(stderr, "job %ld at %s\n", jobno, timestr);
+       strftime(timestr, TIMESIZE, TIMEFORMAT_POSIX, runtime);
+       fprintf(stderr, "job %ld at %s\n", jobno, timestr);
+    }
 
     /* Signal atd, if present. Usual precautions taken... */
     fd = open(PIDFILE, O_RDONLY);
@@ -749,7 +752,7 @@
     char *pgm;
 
     int program = AT;          /* our default program */
-    char *options = "q:f:MmbvlrdhVct:";        /* default options for at */
+    char *options = "q:f:MmbvlrdhVct:s";       /* default options for at */
     int disp_version = 0;
     time_t timer = 0;
     struct passwd *pwe;
@@ -864,6 +867,10 @@
            timer -= timer % 60;
            break;
 
+       case 's':
+           silent = 1;
+           break;
+
        default:
            usage();
            break;
@@ -946,7 +953,9 @@
           It also alows a warning diagnostic to be printed.  Because of the
           possible variance, we always output the diagnostic. */
 
-       fprintf(stderr, "warning: commands will be executed using /bin/sh\n");
+       if (!silent) {
+           fprintf(stderr, "warning: commands will be executed using 
/bin/sh\n");
+       }
 
        writefile(timer, queue);
        break;
diff -ru at-3.1.23.orig/panic.c at-3.1.23/panic.c
--- at-3.1.23.orig/panic.c      2018-07-24 14:41:23.000000000 +0200
+++ at-3.1.23/panic.c   2020-07-26 14:12:56.671279837 +0200
@@ -92,8 +92,8 @@
 {
 /* Print usage and exit.
  */
-    fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-mMlbv] timespec ...\n"
-            "       at [-V] [-q x] [-f file] [-mMlbv] -t time\n"
+    fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-mMlbvs] timespec ...\n"
+            "       at [-V] [-q x] [-f file] [-mMlbvs] -t time\n"
            "       at -c job ...\n"
            "       atq [-V] [-q x]\n"
            "       at [ -rd ] job ...\n"

Reply via email to