in reply to reg ex and the prompt

You could try something simpler, first. The prompt might not be what you are expecting:

[\]\$\>\#]\s

Replies are listed 'Best First'.
Re: Re: reg ex and the prompt
by sauoq (Abbot) on Jun 03, 2003 at 20:07 UTC

    Why all that backwhacking?

    Something like /[]$#%>]\s*$/ will probably work in most cases. (I hate to even include a ']' in there but some people use it.) For /bin/sh, $ and # are by far the most common prompt endings, with or without following space.

    -sauoq
    "My two cents aren't worth a dime.";