NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: .cshrc elm and PIDs



On Mon, 23 Nov 2020 at 13:10, Steve Blinkhorn <steve%prd.co.uk@localhost> wrote:
>
> I monitor incoming emails on several user accounts in xterms stacked
> in one icewm workspace.  Being long in the tooth I use elm for email
> and csh as my shell, and have done since the Dawn of Time.
>
> If a system reboot is needed, setting these (and various other
> workspaces) up by hand can be laborious.  So my X startup files are
> configured to start a whole bunch of xterms in a handful of
> workspaces, and elm is started for the first xterm for each user
> account from .cshrc thus:
>
> pgrep -u `id -u` elm
> if ($status == 1) then
> elm
>     if ($status == 1) then
>     CM
>     elm
>     endif
> endif
>
> So we:
> - check for the existence of an elm PID, failing which run elm
> - if elm fails (always because a temporary file alread exists), use CM
>   (a local alias that removes the temporary file)
> - run elm
>
> This makes a restart to the point where I can work very much faster.
> BUT the PID for the successful elm process keeps showing up in the
> text when I'm writing emails, and ~ substitution doesn't work within
> elm, e.g. fro reading in the content of signature files (I use vi as
> my editor, but I suppose you guessed that).
>
> There is only one further line in the .cshrc files, which is
>
> umask 022
>
> I'm guessing that umask is internal to csh, so elm is the last process
> to be started from .cshrc.  But I'd like to understand what's going on
> as well as fix it.

To avoid the symptom of the PID showing up you should be able to add
>/dev/null to the pgrep line.

To track down the cause...
Are you running this script in the background, or re-running it
periodically (at a time which would account for the PID showing up in
the text)?
Maybe add a "date >> $HOME/log" to the script to record when it gets run

On the ~ - is that form within elm or within vi-in-elm? (Sorry, its
been too long since I switched to pine for my elm neurons :-p

David
Do you have any of your setup conditionalised on being in an interactive shell?


Home | Main Index | Thread Index | Old Index