Stephen Isard wrote in
 <[email protected]>:
 |On Fri, 22 Jul 2022, hbezemer-at-kliksafe.nl |s-nail| wrote:
 |> I want to delete all mail which is older then one year. This can be 
 |> done with the '(before date)' search expression as described in the 
 |> manpage. To automate this process, I would like to use the shell 
 |> date(1) command to get the date one year ago. How can I import the 
 |> outcome of command into mailx? I get the right string with: date 
 |> --date='last year' +%d-%b-%Y So I'm looking for something like: ?move 
 |> '(before <outputfromdatecommand>)' +Trash
 |
 |If you call s-nail with
 |
 |s-nail -S yearold=`date --date='last year' +%d-%b-%Y`
 |
 |the variable yearold within s-nail will contain the date string.

It should be possible to script this in the MUA alone, even if the
syntax is crude (and letting error handling etc. aside):

  $ mailx -#:/
  ? vexpr date-utc
  dutc_year=2022 dutc_month=7 dutc_day=22 dutc_hour=22 dutc_min=38 dutc_sec=50
  ? vput vexpr x date-utc
  ? echo $x
  dutc_year=2022 dutc_month=7 dutc_day=22 dutc_hour=22 dutc_min=39 dutc_sec=12
  ? eval set $x
  ? echo $dutc_year
  2022
  ? vput vexpr dutc_year - $dutc_year 1
  ? var dutc_year version v15-compat
  set dutc_year=2021
  #set version=v14.9.24
  #variable not set: v15-compat

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to