[comp.mail.mush] Can I do these?

scott@grlab.UUCP (Scott Blachowicz) (05/13/89)

Is there a way to do (or request enhancement or fix bug):
   1) Can I pipe a UN*X command into a Mush variable? This is so I can do
      something like this in my .mushrc:
         expr '${COLUMNS:-80}' - 54 | set subject_len
         set hdr_format = "%22n %M%-02N %T (%-3.5lL)%.${subject_len}s"
         ...or...
         set subject_len = "`expr '${COLUMNS:-80}' - 54`"
         set hdr_format = "%22n %M%-02N %T (%-3.5lL)%.${subject_len}s"
   
   2) With the above hdr_format, the "%n" field will substitute
      something like "TO: addressee" if mush recognizes me as the sender.
      It looks like is only looking at the username field of an address
      that looks like "other_site!scott" and comparing with my username.
      Seems it should look at the user's machine name (the alts command
      list), too. Am I missing a variable setting somewhere or is it
      supposed to work this way?
   
   3) Is there some way to have the curses mode "update" command go
      ahead and update the folder without asking?

Thanx,
Scott Blachowicz
USPS:  Graphicus                UUCP:    ...!hpubvwa!grlab!scott
       150 Lake Str S, #206     VoicePh: 206/828-4691
       Kirkland, WA 98033       FAX:     206/828-4236

schaefer@ogccse.ogc.edu (Barton E. Schaefer) (05/17/89)

In article <7330005@grlab.UUCP> scott@grlab.UUCP (Scott Blachowicz) writes:
} Is there a way to do (or request enhancement or fix bug):
}    1) Can I pipe a UN*X command into a Mush variable?

Not in the present version.  Mush pipes (and `command` quoting) are not
text pipes, and are not dealt with in any way remotely like sh/csh pipes.
(For one thing, mush never forks a new process when piping, it simply
captures the pipe "output" and passes it to the next command.)  The work
required to provide piping/capture of arbitrary text in the exisiting
command framework is considerable (and hence not likely to be done soon).

What you CAN do is set an environment variable from .profile or .cshrc
and then use the value of the environment variable in .mushrc.  Or use
curses mode, which automatically truncates at the right edge of the screen
in order to force one header per line.

}          set hdr_format = "%22n %M%-02N %T (%-3.5lL)%.${subject_len}s"
}    
}    2) With the above hdr_format, the "%n" field will substitute
}       something like "TO: addressee" if mush recognizes me as the sender.
}       It looks like is only looking at the username field of an address
}       that looks like "other_site!scott" and comparing with my username.
}       Seems it should look at the user's machine name (the alts command
}       list), too. Am I missing a variable setting somewhere or is it
}       supposed to work this way?

It is "supposed" to work that way.  That isn't completely correct -- you
are right that it sould look at alts etc. -- but the function that generates
those header strings is used extensively and needs to be kept fast, so
it sacrifices some completeness.  A future version will do this "right".

}    3) Is there some way to have the curses mode "update" command go
}       ahead and update the folder without asking?

You can always re-bind the key:

    bind-macro \CU '[line-mode]update\n'
-- 
Bart Schaefer       "And if you believe that, you'll believe anything."
							-- DangerMouse
CSNET / Internet                schaefer@cse.ogc.edu
UUCP                            ...{sequent,tektronix,verdix}!ogccse!schaefer