[email protected] wrote:
 > Paul Fox writes:
 > >[email protected] wrote:
 > > > Greetings.
 > > > 
 > > > ali has two switches for aliases with multiple addresses:
 > > > 
 > > > ali -list will print one address on each line
 > > > 
 > > > ali -nolist will print addresses on "as few lines as possible"
 > > > 
 > > > Can there be an option to force ali to print all addresses on one long 
 > > > line
 > >?
 > >
 > >How about
 > >    echo $(ali -list alias)
 > >or 
 > >    echo $(ali -nolist alias)
 > >depending on whether you want the comma separators or not.
 > 
 > That works, but only for a single alias.  I was hoping to get a list of
 > all aliases, each alias/group on a single line.
 > 
 > Backstory -- Sometimes I use mutt, and I'd like to dynamically import
 > all of my NMH aliases into mutt. So i'm using this command
 > 
 > ali | sed -e 's/://' -e 's/^/alias /'
 > 
 > which works great, as long as each alias/group is on a single line.
 > 

A quick google just led me to a sed option I didn't know about, '-z',
which sets the input record separator to NUL, rather than '\n'.

Try:
    ali -nolist | sed -z 's/,\n/,/g'

(I'm not saying the all-on-one-line option you're asking for might not
be convenient.  Just pointing out alternatives.)

paul
=----------------------
paul fox, [email protected] (arlington, ma, where it's 44.8 degrees)


Reply via email to